File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Samples/JExtractJNISampleApp/src/main/java/com/example/swift Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ //===----------------------------------------------------------------------===//
2+ //
3+ // This source file is part of the Swift.org open source project
4+ //
5+ // Copyright (c) 2024 Apple Inc. and the Swift.org project authors
6+ // Licensed under Apache License v2.0
7+ //
8+ // See LICENSE.txt for license information
9+ // See CONTRIBUTORS.txt for the list of Swift.org project authors
10+ //
11+ // SPDX-License-Identifier: Apache-2.0
12+ //
13+ //===----------------------------------------------------------------------===//
14+
15+ package com .example .swift ;
16+
17+ // Import swift-extract generated sources
18+
19+ // Import javakit/swiftkit support libraries
20+
21+ import org .swift .swiftkit .SwiftKit ;
22+
23+ public class HelloJava2Swift {
24+
25+ public static void main (String [] args ) {
26+ System .out .print ("Property: java.library.path = " + SwiftKit .getJavaLibraryPath ());
27+
28+ examples ();
29+ }
30+
31+ static void examples () {
32+ MySwiftLibrary .helloWorld ();
33+
34+ MySwiftLibrary .globalTakeInt (1337 );
35+ MySwiftLibrary .globalTakeIntInt (1337 , 42 );
36+
37+ long cnt = MySwiftLibrary .globalWriteString ("String from Java" );
38+ SwiftKit .trace ("count = " + cnt );
39+
40+ long i = MySwiftLibrary .globalMakeInt ();
41+ SwiftKit .trace ("globalMakeInt() = " + i );
42+
43+ System .out .println ("DONE." );
44+ }
45+ }
You can’t perform that action at this time.
0 commit comments