-
Notifications
You must be signed in to change notification settings - Fork 55
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.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
9b624db
Add repositories configuration option in swift-java.config
bo2themax 7bf0de7
Add a repositories configuration example and fix artifactUrls output
bo2themax 6a126ec
Update naming convention
bo2themax ef69b18
Rename descriptionGradleStyle
bo2themax 5a6616b
Add JavaJson Example
bo2themax 9416c56
Change JavaRepositoryDescriptor to enum
bo2themax 149358a
Add JavaRepositoryTests to test dependencies resolving with custom re…
bo2themax 52243ad
Add documentation for swift-java resolve
bo2themax 764d586
Add another non-resolvable config to verify artifactUrls
bo2themax 7f6cd04
Move JavaRepositoryTests to SwiftJavaToolTests
bo2themax 8bb6cfa
Rename JavaJson to OrgAndrejsJson
bo2themax c57c017
Add referenced issue in the document
bo2themax ab8f3ab
[Test] Change minified json to pretty printed
bo2themax f6f9800
Remove System dependency from OrgAndrejsJsonTests
bo2themax de3dab3
Add more referenced documents for JavaRepositoryDescriptor
bo2themax f6ad15f
[Test] Add a SimpleJavaProject to JavaRepositoryTests
bo2themax 8e0687b
Merge branch 'swiftlang:main' into main
bo2themax a61c518
[Test] Update error messages in JavaRepositoryTests.swift
bo2themax 967ccaf
[Test] Add missing license headers
bo2themax 8fe1360
Add JavaResolver in SwiftJavaToolLib to resolve for ResolveCommand
bo2themax be87290
[Test] Move SwiftJavaToolTests/JavaRepositoryTests
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
50 changes: 50 additions & 0 deletions
50
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,50 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// 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")) | ||
|
||
print(json.get("port").toString()) | ||
precondition(json.get("port").as(JavaInteger.self)!.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.