-
Notifications
You must be signed in to change notification settings - Fork 70
Add repositories configuration option in swift-java.config #374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bo2themax
wants to merge
21
commits into
swiftlang:main
Choose a base branch
from
bo2themax:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+985
−285
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
9288349
Add repositories configuration option in swift-java.config
bo2themax 787def1
Add a repositories configuration example and fix artifactUrls output
bo2themax 2eed33a
Update naming convention
bo2themax 7d270f3
Rename descriptionGradleStyle
bo2themax 30f1013
Add JavaJson Example
bo2themax edf1a91
Change JavaRepositoryDescriptor to enum
bo2themax 8d1b780
Add JavaRepositoryTests to test dependencies resolving with custom re…
bo2themax f30d4db
Add documentation for swift-java resolve
bo2themax 6f98a8d
Add another non-resolvable config to verify artifactUrls
bo2themax 4450b49
Move JavaRepositoryTests to SwiftJavaToolTests
bo2themax 81ee741
Rename JavaJson to OrgAndrejsJson
bo2themax 71b56c6
Add referenced issue in the document
bo2themax 6c73cb5
[Test] Change minified json to pretty printed
bo2themax e8ebe5e
Remove System dependency from OrgAndrejsJsonTests
bo2themax 85ed39f
Add more referenced documents for JavaRepositoryDescriptor
bo2themax 391b55b
[Test] Add a SimpleJavaProject to JavaRepositoryTests
bo2themax 6fe8a7c
[Test] Update error messages in JavaRepositoryTests.swift
bo2themax afea9f8
[Test] Add missing license headers
bo2themax 5f85438
Add JavaResolver in SwiftJavaToolLib to resolve for ResolveCommand
bo2themax f340920
[Test] Move SwiftJavaToolTests/JavaRepositoryTests
bo2themax b342e88
[Test] fix generic type inference
bo2themax File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
Samples/JavaDependencySampleApp/Sources/JavaDependencySample/OrgAndrejsJsonTests.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // This source file is part of the Swift.org open source project | ||
| // | ||
| // Copyright (c) 2024 Apple Inc. and the Swift.org project authors | ||
| // Licensed under Apache License v2.0 | ||
| // | ||
| // See LICENSE.txt for license information | ||
| // See CONTRIBUTORS.txt for the list of Swift.org project authors | ||
| // | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| import Foundation | ||
| import SwiftJava | ||
|
|
||
| // Import the json library wrapper: | ||
| import OrgAndrejsJson | ||
|
|
||
| enum OrgAndrejsJsonTests { | ||
| static func run() async throws { | ||
| print("Now testing Json library...") | ||
|
|
||
| let json = Json(#"{"host": "localhost", "port": 80}"#) | ||
|
|
||
| precondition(json.hasOwnProperty("port")) | ||
| let port: JavaInteger = json.get("port")! | ||
|
|
||
| precondition(port.toString() == "80") | ||
| precondition(port.intValue() == 80) | ||
|
|
||
| print("Reading swift-java.config inside OrgAndrejsJson folder...") | ||
|
|
||
| let configPath = String.currentWorkingDirectory.appending("/Sources/OrgAndrejsJson/swift-java.config") | ||
|
|
||
| let config = try JavaClass<Json>().of.url("file://" + configPath)! | ||
|
|
||
| precondition(config.hasOwnProperty("repositories")) | ||
|
|
||
| print(config.toString()) | ||
| } | ||
| } | ||
|
|
||
| private extension String { | ||
| static var currentWorkingDirectory: Self { | ||
| let path = getcwd(nil, 0)! | ||
| defer { free(path) } | ||
| return String(cString: path) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Samples/JavaDependencySampleApp/Sources/OrgAndrejsJson/dummy.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // This source file is part of the Swift.org open source project | ||
| // | ||
| // Copyright (c) 2024 Apple Inc. and the Swift.org project authors | ||
| // Licensed under Apache License v2.0 | ||
| // | ||
| // See LICENSE.txt for license information | ||
| // See CONTRIBUTORS.txt for the list of Swift.org project authors | ||
| // | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // | ||
| //===----------------------------------------------------------------------===// |
15 changes: 15 additions & 0 deletions
15
Samples/JavaDependencySampleApp/Sources/OrgAndrejsJson/swift-java.config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "classes": { | ||
| "org.andrejs.json.Json": "Json", | ||
| "org.andrejs.json.JsonFactory": "JsonFactory" | ||
| }, | ||
| "dependencies": [ | ||
| "org.andrejs:json:1.2" | ||
| ], | ||
| "repositories": [ | ||
| { | ||
| "type": "maven", | ||
| "url": "https://jitpack.io" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.