Skip to content

Commit 0456398

Browse files
committed
Update build.gradle für JavaAppLauncher
There is now an XCode Project for #98 which makes compilation a bit easier (thanks @PatrickWegmann) - but can be run using gradle to copy the App Launcher into the correct location.
1 parent 5f086f8 commit 0456398

File tree

9 files changed

+291
-42
lines changed

9 files changed

+291
-42
lines changed
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 50;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
306932DF2654CD110083886F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DDBFB38226540685004040E5 /* main.m */; };
11+
/* End PBXBuildFile section */
12+
13+
/* Begin PBXCopyFilesBuildPhase section */
14+
DDBFB37D26540685004040E5 /* CopyFiles */ = {
15+
isa = PBXCopyFilesBuildPhase;
16+
buildActionMask = 2147483647;
17+
dstPath = /usr/share/man/man1/;
18+
dstSubfolderSpec = 0;
19+
files = (
20+
);
21+
runOnlyForDeploymentPostprocessing = 1;
22+
};
23+
/* End PBXCopyFilesBuildPhase section */
24+
25+
/* Begin PBXFileReference section */
26+
DDBFB37F26540685004040E5 /* JavaAppLauncher */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = JavaAppLauncher; sourceTree = BUILT_PRODUCTS_DIR; };
27+
DDBFB38226540685004040E5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = SOURCE_ROOT; };
28+
/* End PBXFileReference section */
29+
30+
/* Begin PBXFrameworksBuildPhase section */
31+
DDBFB37C26540685004040E5 /* Frameworks */ = {
32+
isa = PBXFrameworksBuildPhase;
33+
buildActionMask = 2147483647;
34+
files = (
35+
);
36+
runOnlyForDeploymentPostprocessing = 0;
37+
};
38+
/* End PBXFrameworksBuildPhase section */
39+
40+
/* Begin PBXGroup section */
41+
DDBFB37626540685004040E5 = {
42+
isa = PBXGroup;
43+
children = (
44+
DDBFB38226540685004040E5 /* main.m */,
45+
DDBFB38026540685004040E5 /* Products */,
46+
);
47+
sourceTree = "<group>";
48+
};
49+
DDBFB38026540685004040E5 /* Products */ = {
50+
isa = PBXGroup;
51+
children = (
52+
DDBFB37F26540685004040E5 /* JavaAppLauncher */,
53+
);
54+
name = Products;
55+
sourceTree = "<group>";
56+
};
57+
/* End PBXGroup section */
58+
59+
/* Begin PBXNativeTarget section */
60+
DDBFB37E26540685004040E5 /* JavaAppLauncher */ = {
61+
isa = PBXNativeTarget;
62+
buildConfigurationList = DDBFB38626540685004040E5 /* Build configuration list for PBXNativeTarget "JavaAppLauncher" */;
63+
buildPhases = (
64+
DDBFB37B26540685004040E5 /* Sources */,
65+
DDBFB37C26540685004040E5 /* Frameworks */,
66+
DDBFB37D26540685004040E5 /* CopyFiles */,
67+
);
68+
buildRules = (
69+
);
70+
dependencies = (
71+
);
72+
name = JavaAppLauncher;
73+
productName = JavaAppLauncher2;
74+
productReference = DDBFB37F26540685004040E5 /* JavaAppLauncher */;
75+
productType = "com.apple.product-type.tool";
76+
};
77+
/* End PBXNativeTarget section */
78+
79+
/* Begin PBXProject section */
80+
DDBFB37726540685004040E5 /* Project object */ = {
81+
isa = PBXProject;
82+
attributes = {
83+
LastUpgradeCheck = 1240;
84+
TargetAttributes = {
85+
DDBFB37E26540685004040E5 = {
86+
CreatedOnToolsVersion = 12.4;
87+
};
88+
};
89+
};
90+
buildConfigurationList = DDBFB37A26540685004040E5 /* Build configuration list for PBXProject "JavaAppLauncher" */;
91+
compatibilityVersion = "Xcode 9.3";
92+
developmentRegion = en;
93+
hasScannedForEncodings = 0;
94+
knownRegions = (
95+
en,
96+
Base,
97+
);
98+
mainGroup = DDBFB37626540685004040E5;
99+
productRefGroup = DDBFB38026540685004040E5 /* Products */;
100+
projectDirPath = "";
101+
projectRoot = "";
102+
targets = (
103+
DDBFB37E26540685004040E5 /* JavaAppLauncher */,
104+
);
105+
};
106+
/* End PBXProject section */
107+
108+
/* Begin PBXSourcesBuildPhase section */
109+
DDBFB37B26540685004040E5 /* Sources */ = {
110+
isa = PBXSourcesBuildPhase;
111+
buildActionMask = 2147483647;
112+
files = (
113+
306932DF2654CD110083886F /* main.m in Sources */,
114+
);
115+
runOnlyForDeploymentPostprocessing = 0;
116+
};
117+
/* End PBXSourcesBuildPhase section */
118+
119+
/* Begin XCBuildConfiguration section */
120+
DDBFB38526540685004040E5 /* Release */ = {
121+
isa = XCBuildConfiguration;
122+
buildSettings = {
123+
ALWAYS_SEARCH_USER_PATHS = NO;
124+
CLANG_ANALYZER_NONNULL = YES;
125+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
126+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
127+
CLANG_CXX_LIBRARY = "libc++";
128+
CLANG_ENABLE_MODULES = YES;
129+
CLANG_ENABLE_OBJC_ARC = NO;
130+
CLANG_ENABLE_OBJC_WEAK = YES;
131+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
132+
CLANG_WARN_BOOL_CONVERSION = YES;
133+
CLANG_WARN_COMMA = YES;
134+
CLANG_WARN_CONSTANT_CONVERSION = YES;
135+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
136+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
137+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
138+
CLANG_WARN_EMPTY_BODY = YES;
139+
CLANG_WARN_ENUM_CONVERSION = YES;
140+
CLANG_WARN_INFINITE_RECURSION = YES;
141+
CLANG_WARN_INT_CONVERSION = YES;
142+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
143+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
144+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
145+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
146+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
147+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
148+
CLANG_WARN_STRICT_PROTOTYPES = YES;
149+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
150+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
151+
CLANG_WARN_UNREACHABLE_CODE = YES;
152+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
153+
COPY_PHASE_STRIP = NO;
154+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
155+
ENABLE_NS_ASSERTIONS = NO;
156+
ENABLE_STRICT_OBJC_MSGSEND = YES;
157+
GCC_C_LANGUAGE_STANDARD = gnu11;
158+
GCC_NO_COMMON_BLOCKS = YES;
159+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
160+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
161+
GCC_WARN_UNDECLARED_SELECTOR = YES;
162+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
163+
GCC_WARN_UNUSED_FUNCTION = YES;
164+
GCC_WARN_UNUSED_VARIABLE = YES;
165+
HEADER_SEARCH_PATHS = "${JAVA_HOME_PATH}/**";
166+
MACOSX_DEPLOYMENT_TARGET = 10.10;
167+
MTL_ENABLE_DEBUG_INFO = NO;
168+
MTL_FAST_MATH = YES;
169+
SDKROOT = macosx;
170+
};
171+
name = Release;
172+
};
173+
DDBFB38826540685004040E5 /* Release */ = {
174+
isa = XCBuildConfiguration;
175+
buildSettings = {
176+
CODE_SIGN_STYLE = Automatic;
177+
PRODUCT_NAME = "$(TARGET_NAME)";
178+
};
179+
name = Release;
180+
};
181+
/* End XCBuildConfiguration section */
182+
183+
/* Begin XCConfigurationList section */
184+
DDBFB37A26540685004040E5 /* Build configuration list for PBXProject "JavaAppLauncher" */ = {
185+
isa = XCConfigurationList;
186+
buildConfigurations = (
187+
DDBFB38526540685004040E5 /* Release */,
188+
);
189+
defaultConfigurationIsVisible = 0;
190+
defaultConfigurationName = Release;
191+
};
192+
DDBFB38626540685004040E5 /* Build configuration list for PBXNativeTarget "JavaAppLauncher" */ = {
193+
isa = XCConfigurationList;
194+
buildConfigurations = (
195+
DDBFB38826540685004040E5 /* Release */,
196+
);
197+
defaultConfigurationIsVisible = 0;
198+
defaultConfigurationName = Release;
199+
};
200+
/* End XCConfigurationList section */
201+
};
202+
rootObject = DDBFB37726540685004040E5 /* Project object */;
203+
}

native/JavaAppLauncher.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SchemeUserState</key>
6+
<dict>
7+
<key>JavaAppLauncher.xcscheme_^#shared#^_</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>1</integer>
11+
</dict>
12+
</dict>
13+
<key>SuppressBuildableAutocreation</key>
14+
<dict>
15+
<key>DDBFB37E26540685004040E5</key>
16+
<dict>
17+
<key>primary</key>
18+
<true/>
19+
</dict>
20+
</dict>
21+
</dict>
22+
</plist>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SchemeUserState</key>
6+
<dict>
7+
<key>JavaAppLauncher2.xcscheme_^#shared#^_</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>0</integer>
11+
</dict>
12+
</dict>
13+
</dict>
14+
</plist>

native/build.gradle

Lines changed: 37 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,52 @@
1-
apply plugin: 'java'
2-
3-
task getXCrun(type: Exec) {
4-
commandLine "xcrun"
5-
args "--show-sdk-path"
6-
standardOutput = new ByteArrayOutputStream()
7-
ext.run = { return standardOutput.toString().trim() }
1+
plugins {
2+
id "org.openbakery.xcode-plugin" version "0.20.1"
83
}
94

10-
task compileNativeStarter(type: Exec) {
5+
apply plugin: 'java'
116

12-
dependsOn getXCrun
7+
task prepareXCodeBuild() {
138

14-
def outputFile = new File( "${buildDir}", "JavaAppLauncher" )
15-
doFirst {
9+
doLast {
1610
def javahome = System.getProperty( "java.home" )
17-
println javahome += "/..";
11+
def javahomeJRE = javahome;
12+
13+
if ( file("${javahomeJRE}/../jre").exists() ) {
14+
javahomeJRE += "/../jre";
15+
}
16+
17+
def LIBJLI_DY_LIB="${javahomeJRE}/lib/libjli.dylib"
18+
if ( !file(LIBJLI_DY_LIB).exists() ) {
19+
LIBJLI_DY_LIB="${javahomeJRE}/lib/jli/libjli.dylib"
20+
}
1821

19-
args "-v"
20-
args "-arch"
21-
args "x86_64"
22-
args "-arch"
23-
args "i386"
24-
args "-I"
25-
args "${javahome}/include"
26-
args "-I"
27-
args "${javahome}/include/darwin"
28-
args "-DLIBJLI_DYLIB=\"${javahome}/jre/lib/jli/libjli.dylib\""
29-
args "-framework"
30-
args "Cocoa"
31-
args "-F"
32-
args "${javahome}/../.."
33-
args "-isysroot"
34-
args "${getXCrun.run()}"
35-
args "-mmacosx-version-min=10.7"
36-
args "-fobjc-exceptions"
37-
args "-std=c99"
38-
args "-o"
39-
args outputFile
40-
args "main.m"
41-
}
22+
println "JAVA_HOME: ${javahome}";
23+
println "JAVA_HOME_JRE: ${javahomeJRE}";
24+
println "LIBJLI_DY_LIB: ${LIBJLI_DY_LIB}";
25+
26+
xcodebuild.environment = [
27+
"JAVA_HOME_PATH": new String("${javahomeJRE}")
28+
"LIBJLI_DYLIB": new String("${LIBJLI_DY_LIB}")
29+
]
30+
}
31+
}
4232

43-
doLast {
33+
task finalizeXCodeBuild() {
34+
doLast {
35+
def outputFile = new File( "${buildDir}/sym/Release", "JavaAppLauncher" )
4436
outputFile.setExecutable( true, false)
4537
copy {
4638
from( outputFile )
4739
into('../src/com/oracle/appbundler')
4840
}
49-
}
50-
51-
workingDir "."
52-
outputs.file( outputFile )
41+
}
42+
}
5343

54-
commandLine "/usr/bin/gcc"
44+
xcodebuild {
45+
scheme = 'JavaAppLauncher'
46+
target = 'JavaAppLauncher'
47+
configuration = 'Release'
48+
type = 'macOS'
49+
destination = "${buildDir}"
5550
}
5651

57-
defaultTasks = ["compileNativeStarter", "clean"]
52+
defaultTasks = [ "prepareXCodeBuild", "xcodebuild", "finalizeXCodeBuild", "clean"]
70.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)