Skip to content

Commit 34aff50

Browse files
committed
fix all configs
1 parent b3f20ab commit 34aff50

File tree

18 files changed

+43
-31
lines changed

18 files changed

+43
-31
lines changed

.licenseignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ gradlew.bat
4141
**/gradlew.bat
4242
**/ci-validate.sh
4343
**/DO_NOT_EDIT.txt
44-
Plugins/**/_PluginsShared
44+
Plugins/**/_PluginsShared
45+
Plugins/**/0_PLEASE_SYMLINK*

Package.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ let package = Package(
174174
.target(
175175
name: "JavaKit",
176176
dependencies: ["JavaRuntime", "JavaKitMacros", "JavaTypes"],
177-
exclude: ["Java2Swift.config"],
177+
exclude: ["swift-java.config"],
178178
swiftSettings: [
179179
.swiftLanguageMode(.v5),
180180
.unsafeFlags(["-I\(javaIncludePath)", "-I\(javaPlatformIncludePath)"])
@@ -201,7 +201,7 @@ let package = Package(
201201
.target(
202202
name: "JavaKitCollection",
203203
dependencies: ["JavaKit"],
204-
exclude: ["Java2Swift.config"],
204+
exclude: ["swift-java.config"],
205205
swiftSettings: [
206206
.swiftLanguageMode(.v5),
207207
.unsafeFlags(["-I\(javaIncludePath)", "-I\(javaPlatformIncludePath)"])
@@ -210,7 +210,7 @@ let package = Package(
210210
.target(
211211
name: "JavaKitFunction",
212212
dependencies: ["JavaKit"],
213-
exclude: ["Java2Swift.config"],
213+
exclude: ["swift-java.config"],
214214
swiftSettings: [
215215
.swiftLanguageMode(.v5),
216216
.unsafeFlags(["-I\(javaIncludePath)", "-I\(javaPlatformIncludePath)"])
@@ -219,7 +219,7 @@ let package = Package(
219219
.target(
220220
name: "JavaKitJar",
221221
dependencies: ["JavaKit", "JavaKitCollection"],
222-
exclude: ["Java2Swift.config"],
222+
exclude: ["swift-java.config"],
223223
swiftSettings: [
224224
.swiftLanguageMode(.v5),
225225
.unsafeFlags(["-I\(javaIncludePath)", "-I\(javaPlatformIncludePath)"])
@@ -228,7 +228,7 @@ let package = Package(
228228
.target(
229229
name: "JavaKitNetwork",
230230
dependencies: ["JavaKit", "JavaKitCollection"],
231-
exclude: ["Java2Swift.config"],
231+
exclude: ["swift-java.config"],
232232
swiftSettings: [
233233
.swiftLanguageMode(.v5),
234234
.unsafeFlags(["-I\(javaIncludePath)", "-I\(javaPlatformIncludePath)"])
@@ -237,7 +237,7 @@ let package = Package(
237237
.target(
238238
name: "JavaKitReflection",
239239
dependencies: ["JavaKit", "JavaKitCollection"],
240-
exclude: ["Java2Swift.config"],
240+
exclude: ["swift-java.config"],
241241
swiftSettings: [
242242
.swiftLanguageMode(.v5),
243243
.unsafeFlags(["-I\(javaIncludePath)", "-I\(javaPlatformIncludePath)"])

Plugins/JExtractSwiftCommandPlugin/JExtractSwiftCommandPlugin.swift

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===----------------------------------------------------------------------===//
1+
//---------------------------------------------===-------------------------===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
@@ -10,7 +10,7 @@
1010
//
1111
// SPDX-License-Identifier: Apache-2.0
1212
//
13-
//===----------------------------------------------------------------------===//
13+
//---------------------------------------------===-------------------------===//
1414

1515
import Foundation
1616
import PackagePlugin
@@ -32,11 +32,13 @@ final class JExtractSwiftCommandPlugin: SwiftJavaPluginProtocol, BuildToolPlugin
3232
var buildOutputs: Bool = true
3333

3434
func createBuildCommands(context: PluginContext, target: any Target) async throws -> [Command] {
35+
print("JEXTRACT COMMAND CREATE BUILD COMMANDS ================================")
3536
// FIXME: This is not a build plugin but SwiftPM forces us to impleme the protocol anyway? rdar://139556637
3637
return []
3738
}
3839

3940
func performCommand(context: PluginContext, arguments: [String]) throws {
41+
print("JEXTRACT COMMAND ================================")
4042
// Plugin can't have dependencies, so we have some naive argument parsing instead:
4143
self.verbose = arguments.contains("-v") || arguments.contains("--verbose")
4244

@@ -97,16 +99,16 @@ final class JExtractSwiftCommandPlugin: SwiftJavaPluginProtocol, BuildToolPlugin
9799
func performCommand(context: PluginContext, target: Target, extraArguments _: [String]) throws {
98100
guard let sourceModule = target.sourceModule else { return }
99101

100-
if self.buildInputs {
101-
// Make sure the target can builds properly
102-
log("Pre-building target '\(target.name)' before extracting sources...")
103-
let targetBuildResult = try self.packageManager.build(.target(target.name), parameters: .init())
104-
105-
guard targetBuildResult.succeeded else {
106-
print("[swift-java-command] Build of '\(target.name)' failed: \(targetBuildResult.logText)")
107-
return
108-
}
109-
}
102+
// if self.buildInputs {
103+
// // Make sure the target can builds properly
104+
// log("Pre-building target '\(target.name)' before extracting sources...")
105+
// let targetBuildResult = try self.packageManager.build(.target(target.name), parameters: .init())
106+
//
107+
// guard targetBuildResult.succeeded else {
108+
// print("[swift-java-command] Build of '\(target.name)' failed: \(targetBuildResult.logText)")
109+
// return
110+
// }
111+
// }
110112

111113
let arguments = try prepareJExtractArguments(context: context, target: target)
112114

Plugins/Java2SwiftPlugin/Java2SwiftPlugin.swift

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===----------------------------------------------------------------------===//
1+
//---------------------------------------------===-------------------------===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
@@ -10,12 +10,12 @@
1010
//
1111
// SPDX-License-Identifier: Apache-2.0
1212
//
13-
//===----------------------------------------------------------------------===//
13+
//---------------------------------------------===-------------------------===//
1414

1515
import Foundation
1616
import PackagePlugin
1717

18-
fileprivate let Java2SwiftConfigFileName = "Java2Swift.config"
18+
fileprivate let SwiftJavaConfigFileName = "swift-java.config"
1919

2020
@main
2121
struct Java2SwiftBuildToolPlugin: SwiftJavaPluginProtocol, BuildToolPlugin {
@@ -24,16 +24,23 @@ struct Java2SwiftBuildToolPlugin: SwiftJavaPluginProtocol, BuildToolPlugin {
2424
var verbose: Bool = getEnvironmentBool("SWIFT_JAVA_VERBOSE")
2525

2626
func createBuildCommands(context: PluginContext, target: Target) throws -> [Command] {
27+
print("JAVA2Swift ================================")
28+
print("JAVA2Swift ================================")
29+
print("JAVA2Swift ================================")
30+
print("JAVA2Swift ================================")
31+
print("JAVA2Swift ================================")
32+
2733
guard let sourceModule = target.sourceModule else { return [] }
2834

35+
2936
// Note: Target doesn't have a directoryURL counterpart to directory,
3037
// so we cannot eliminate this deprecation warning.
3138
let sourceDir = target.directory.string
3239

3340
// The name of the configuration file JavaKit.config from the target for
3441
// which we are generating Swift wrappers for Java classes.
3542
let configFile = URL(filePath: sourceDir)
36-
.appending(path: "Java2Swift.config")
43+
.appending(path: SwiftJavaConfigFileName)
3744
let configData = try Data(contentsOf: configFile)
3845
let config = try JSONDecoder().decode(Configuration.self, from: configData)
3946

@@ -45,7 +52,7 @@ struct Java2SwiftBuildToolPlugin: SwiftJavaPluginProtocol, BuildToolPlugin {
4552

4653
// Look for a config file within this target.
4754
let dependencyConfigURL = dependencyURL
48-
.appending(path: Java2SwiftConfigFileName)
55+
.appending(path: SwiftJavaConfigFileName)
4956
let dependencyConfigString = dependencyConfigURL
5057
.path(percentEncoded: false)
5158

Plugins/JavaCompilerPlugin/JavaCompilerPlugin.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import PackagePlugin
1818
@main
1919
struct JavaCompilerBuildToolPlugin: BuildToolPlugin {
2020
func createBuildCommands(context: PluginContext, target: Target) throws -> [Command] {
21+
print("COMPILER PLUGIN ================================")
2122
guard let sourceModule = target.sourceModule else { return [] }
2223

2324
// Collect all of the Java source files within this target's sources.

Plugins/PluginsShared/Configuration.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===----------------------------------------------------------------------===//
1+
//---------------------------------------------===-------------------------===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
@@ -10,7 +10,7 @@
1010
//
1111
// SPDX-License-Identifier: Apache-2.0
1212
//
13-
//===----------------------------------------------------------------------===//
13+
//---------------------------------------------===-------------------------===//
1414

1515
import Foundation
1616

Plugins/PluginsShared/SwiftJavaPluginProtocol.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ protocol SwiftJavaPluginProtocol {
2121

2222
extension SwiftJavaPluginProtocol {
2323
func log(_ message: @autoclosure () -> String, terminator: String = "\n") {
24-
if self.verbose {
25-
print("[swift-java-command] \(message())", terminator: terminator)
26-
}
24+
// if self.verbose {
25+
print("[\(pluginName)] \(message())", terminator: terminator)
26+
// }
2727
}
2828
}

Plugins/SwiftJavaPlugin/JExtractSwiftPlugin.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ struct JExtractSwiftBuildToolPlugin: SwiftJavaPluginProtocol, BuildToolPlugin {
2222
var verbose: Bool = getEnvironmentBool("SWIFT_JAVA_VERBOSE")
2323

2424
func createBuildCommands(context: PluginContext, target: Target) throws -> [Command] {
25+
print("JEXTRACT BUILD COMMANDS PLAIN PLUGIN ================================")
2526
let toolURL = try context.tool(named: "JExtractSwiftTool").url
2627

2728
guard let sourceModule = target.sourceModule else { return [] }

0 commit comments

Comments
 (0)