Skip to content

Commit 0dee9fe

Browse files
committed
WIP
1 parent 4c27964 commit 0dee9fe

File tree

4 files changed

+7
-69
lines changed

4 files changed

+7
-69
lines changed

Samples/SwiftKitSampleApp/src/jmh/java/org/swift/swiftkit/JavaToSwiftBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static class BenchmarkState {
3737
@Setup(Level.Trial)
3838
public void beforeAll() {
3939
arena = SwiftArena.ofConfined();
40-
obj = new MySwiftClass(arena, 1, 2);
40+
obj = new MySwiftClass(1, 2, arena);
4141
}
4242

4343
@TearDown(Level.Trial)

Samples/SwiftKitSampleApp/src/jmh/java/org/swift/swiftkit/StringPassingBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class StringPassingBenchmark {
4646
@Setup(Level.Trial)
4747
public void beforeAll() {
4848
arena = SwiftArena.ofConfined();
49-
obj = new MySwiftClass(arena, 1, 2);
49+
obj = new MySwiftClass(1, 2, arena);
5050
string = makeString(stringLen);
5151
}
5252

Sources/JExtractSwift/Swift2JavaVisitor.swift

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -16,67 +16,6 @@ import Foundation
1616
import SwiftParser
1717
import SwiftSyntax
1818

19-
//final class Swift2JavaTranslateVisitor {
20-
// func translate(decl node: DeclSyntax, into typeContext: ImportedNominalType?) {
21-
// switch node.as(DeclSyntaxEnum.self) {
22-
//
23-
// case .structDecl(let node):
24-
// self.translate(nominalTypeDecl: node, into: typeContext)
25-
// case .enumDecl(let node):
26-
// self.translate(nominalTypeDecl: node, into: typeContext)
27-
// case .classDecl(let node):
28-
// self.translate(nominalTypeDecl: node, into: typeContext)
29-
// case .actorDecl(let node):
30-
// self.translate(nominalTypeDecl: node, into: typeContext)
31-
// case .protocolDecl(let node):
32-
// self.translate(nominalTypeDecl: node, into: typeContext)
33-
// case .extensionDecl(let node):
34-
// self.translate(extensionDecl: node, into: typeContext)
35-
//
36-
// case .functionDecl(let node):
37-
// self.translate(functionDecl: node, into: typeContext)
38-
// case .subscriptDecl(let node):
39-
// self.translate(subscriptDecl: node, into: typeContext)
40-
// case .variableDecl(let node):
41-
// self.translate(variableDecl: node, into: typeContext)
42-
// }
43-
// }
44-
//
45-
// func translate(sourceFile node: SourceFileSyntax) {
46-
// for code in node.statements {
47-
// guard let decl = code.item.as(DeclSyntax.self) else {
48-
// return
49-
// }
50-
// self.translate(decl: decl, into: nil)
51-
// }
52-
// }
53-
//
54-
// func translate(nominalTypeDecl node: some NamedDeclSyntax & DeclGroupSyntax & WithAttributesSyntax & WithModifiersSyntax, into typeContext: ImportedNominalType?) {
55-
// guard let importedNominal = translator.importedNominalType(node, typeContext) else {
56-
// return
57-
// }
58-
// for member in node.memberBlock.members {
59-
// self.translate(decl: member.decl, into: importedNominal)
60-
// }
61-
// }
62-
//
63-
// func translate(extensionDecl node: ExtensionDeclSyntax, into typeContext: ImportedNominalType?) throws {
64-
// guard typeContext == nil else {
65-
// return
66-
// }
67-
// }
68-
//
69-
// func translate(functionDecl node: FunctionDeclSyntax, into typeContext: ImportedNominalType?) throws {
70-
// self.translator.importedFunc(node, typeContext)
71-
// }
72-
// func translate(subscriptDecl node: SubscriptDeclSyntax, into typeContext: ImportedNominalType?) throws {
73-
// SwiftFunctionSignature(node, enclosingType: <#T##SwiftType?#>, symbolTable: SwiftSymbolTable)
74-
// }
75-
// func translate(variableDecl node: VariableDeclSyntax, into typeContext: ImportedNominalType?) throws {
76-
// SwiftFunctionSignature(node, enclosingType: <#T##SwiftType?#>, symbolTable: SwiftSymbolTable)
77-
// }
78-
//}
79-
8019
final class Swift2JavaVisitor: SyntaxVisitor {
8120
let translator: Swift2JavaTranslator
8221

settings.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ rootProject.name = "swift-java"
2020

2121
include "SwiftKit"
2222

23-
include ":Samples:SwiftKitSampleApp"
2423
// Include sample apps -- you can run them via `gradle Name:run`
25-
//new File(rootDir, "Samples").listFiles().each {
26-
// if (it.directory && new File(it, 'build.gradle').exists()) {
27-
// include ":Samples:${it.name}"
28-
// }
29-
//}
24+
new File(rootDir, "Samples").listFiles().each {
25+
if (it.directory && new File(it, 'build.gradle').exists()) {
26+
include ":Samples:${it.name}"
27+
}
28+
}

0 commit comments

Comments
 (0)