Skip to content

Commit 6796454

Browse files
committed
fixing paths for linux
1 parent a01dede commit 6796454

File tree

8 files changed

+25
-22
lines changed

8 files changed

+25
-22
lines changed

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Gradle build
3636
run: ./gradlew build -x test # just build
3737
- name: Gradle check
38-
run: ./gradlew check --info
38+
run: ./gradlew :SwiftKit:check --info
3939
- name: Gradle compile benchmarks
4040
run: ./gradlew compileJmh --info
4141

BuildLogic/src/main/kotlin/build-logic.java-common-conventions.gradle.kts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,3 @@ tasks.withType<Test> {
9191
this.showStandardStreams = true
9292
}
9393
}
94-
95-
96-
// TODO: This is a crude workaround, we'll remove 'make' soon and properly track build dependencies
97-
// val buildSwiftJExtract = tasks.register<Exec>("buildMake") {
98-
// description = "Triggers 'make' build"
99-
//
100-
// workingDir(rootDir)
101-
// commandLine("make")
102-
// }
103-
//
104-
// tasks.build {
105-
// dependsOn(buildSwiftJExtract)
106-
// }
107-

Plugins/JExtractSwiftCommandPlugin/JExtractSwiftCommandPlugin.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ final class JExtractSwiftCommandPlugin: BuildToolPlugin, CommandPlugin {
5252

5353
for target in context.package.targets {
5454
guard let configPath = getSwiftJavaConfig(target: target) else {
55-
log("Skipping target '\(target.name), has no 'swift-java.config' file")
55+
log("Skipping target '\(target.name)', has no 'swift-java.config' file")
5656
continue
5757
}
5858

@@ -63,8 +63,8 @@ final class JExtractSwiftCommandPlugin: BuildToolPlugin, CommandPlugin {
6363
print("[swift-java-command] error: Failed to extract from target '\(target.name)': \(error)")
6464
}
6565

66-
print("[swift-java-command] Done.")
6766
}
67+
print("[swift-java-command] Generating sources: " + "done".green + ".")
6868
}
6969

7070
/// Perform the command on a specific target.
@@ -146,3 +146,10 @@ final class JExtractSwiftCommandPlugin: BuildToolPlugin, CommandPlugin {
146146
}
147147
}
148148
}
149+
150+
// Mini coloring helper, since we cannot have dependencies we keep it minimal here
151+
extension String {
152+
var green: String {
153+
"\u{001B}[0;32m" + "\(self)" + "\u{001B}[0;0m"
154+
}
155+
}

Sources/JExtractSwift/Swift2JavaVisitor.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ final class Swift2JavaVisitor: SyntaxVisitor {
136136

137137
// TODO: filter out kinds of variables we cannot import
138138

139-
self.log.info("Import variable: \(node.kind) \(fullName)")
139+
self.log.debug("Import variable: \(node.kind) \(fullName)")
140140

141141
let returnTy: TypeSyntax
142142
if let typeAnnotation = binding.typeAnnotation {
@@ -167,7 +167,7 @@ final class Swift2JavaVisitor: SyntaxVisitor {
167167
}
168168

169169
if let currentTypeName {
170-
log.info("Record variable in \(currentTypeName)")
170+
log.debug("Record variable in \(currentTypeName)")
171171
translator.importedTypes[currentTypeName]!.variables.append(varDecl)
172172
} else {
173173
fatalError("Global variables are not supported yet: \(node.debugDescription)")

SwiftKit/src/main/java/org/swift/swiftkit/SwiftKit.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
public class SwiftKit {
2929

3030
public static final String STDLIB_DYLIB_NAME = "swiftCore";
31+
public static final String SWIFTKITSWIFT_DYLIB_NAME = "SwiftKitSwift";
3132
private static final String STDLIB_MACOS_DYLIB_PATH = "/usr/lib/swift/libswiftCore.dylib";
3233

3334
private static final Arena LIBRARY_ARENA = Arena.ofAuto();
@@ -38,7 +39,6 @@ public class SwiftKit {
3839

3940
static boolean initializeLibs() {
4041
System.loadLibrary(STDLIB_DYLIB_NAME);
41-
System.loadLibrary("SwiftKitSwift");
4242
return true;
4343
}
4444

SwiftKit/src/test/java/org/swift/swiftkit/SwiftRuntimeMetadataTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,19 @@
1515
package org.swift.swiftkit;
1616

1717
import org.junit.jupiter.api.Assertions;
18+
import org.junit.jupiter.api.BeforeEach;
1819
import org.junit.jupiter.api.Test;
1920

2021
public class SwiftRuntimeMetadataTest {
2122

23+
@BeforeEach
24+
void setUp() {
25+
System.out.println("Java path ====== '" + SwiftKit.getJavaLibraryPath() + "'");
26+
for (var path : SwiftKit.getJavaLibraryPath().split(":")) {
27+
System.out.println(" " + path);
28+
}
29+
}
30+
2231
@Test
2332
public void integer_layout_metadata() {
2433
SwiftAnyType swiftType = SwiftKit.getTypeByMangledNameInEnvironment("Si").get();

buildSrc/src/main/groovy/org/swift/swiftkit/gradle/BuildUtils.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ final class BuildUtils {
3838
/* macOS */ (osArch == "aarch64" ?
3939
"${base}../../.build/arm64-apple-macosx/debug/" :
4040
"${base}../../.build/${osArch}-apple-macosx/debug/"),
41+
"SOMETHING"
4142
]
4243
def releasePaths = debugPaths.collect { it.replaceAll("debug", "release") }
4344
def systemPaths = [

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ ENV PATH="$PATH:/usr/lib/jvm/default-jdk/bin"
2626

2727
# Install "untested" nightly 'main' Swift
2828
# TODO: Only do this if the released Swift is older than what we require
29-
COPY install_untested_nightly_swift.sh .
30-
RUN bash -xc './install_untested_nightly_swift.sh'
29+
#COPY install_untested_nightly_swift.sh .
30+
RUN #bash -xc './install_untested_nightly_swift.sh'

0 commit comments

Comments
 (0)