-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.sh
99 lines (85 loc) · 3.41 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
set -e
MVNW="./mvnw"
function mac_desktop {
"$MVNW" "package" "-DskipTests" "-Dcodename1.platform=javase" "-Dcodename1.buildTarget=mac-os-x-desktop" "-U" "-e"
}
function windows_desktop {
"$MVNW" "package" "-DskipTests" "-Dcodename1.platform=javase" "-Dcodename1.buildTarget=windows-desktop" "-U" "-e"
}
function windows_device {
"$MVNW" "package" "-DskipTests" "-Dcodename1.platform=win" "-Dcodename1.buildTarget=windows-device" "-U" "-e"
}
function uwp {
"windows_device"
}
function javascript {
"$MVNW" "package" "-DskipTests" "-Dcodename1.platform=javascript" "-Dcodename1.buildTarget=javascript" "-U" "-e"
}
function android {
"$MVNW" "package" "-DskipTests" "-Dcodename1.platform=android" "-Dcodename1.buildTarget=android-device" "-U" "-e"
}
function xcode {
"$MVNW" "package" "-DskipTests" "-Dcodename1.platform=ios" "-Dcodename1.buildTarget=ios-source" "-U" "-e"
}
function ios_source {
"xcode"
}
function android_source {
"$MVNW" "package" "-DskipTests" "-Dcodename1.platform=android" "-Dcodename1.buildTarget=android-source" "-U" "-e"
}
function ios {
"$MVNW" "package" "-DskipTests" "-Dcodename1.platform=ios" "-Dcodename1.buildTarget=ios-device" "-U" "-e"
}
function ios_release {
"$MVNW" "package" "-DskipTests" "-Dcodename1.platform=ios" "-Dcodename1.buildTarget=ios-device-release" "-U" "-e"
}
function jar {
"$MVNW" "-Pexecutable-jar" "package" "-Dcodename1.platform=javase" "-DskipTests" "-U" "-e"
}
function help {
"echo" "-e" "build.sh [COMMAND]"
"echo" "-e" "Local Build Commands:"
"echo" "-e" " The following commands will build the app locally (i.e. does NOT use the Codename One build server)"
"echo" "-e" ""
"echo" "-e" " jar"
"echo" "-e" " Builds app as desktop app executable jar file to javase/target directory"
"echo" "-e" " android_source"
"echo" "-e" " Generates an android gradle project that can be opened in Android studio"
"echo" "-e" " *Requires android development tools installed."
"echo" "-e" " *Requires ANDROID_HOME environment variable"
"echo" "-e" " *Requires either GRADLE_HOME environment variable, or for gradle to be in PATH"
"echo" "-e" " ios_source"
"echo" "-e" " Generates an Xcode Project that you can open and build using Apple's development tools"
"echo" "-e" " *Requires a Mac with Xcode installed"
"echo" "-e" ""
"echo" "-e" "Build Server Commands:"
"echo" "-e" " The following commands will build the app using the Codename One build server, and require"
"echo" "-e" " a Codename One account. See https://www.codenameone.com"
"echo" "-e" ""
"echo" "-e" " ios"
"echo" "-e" " Builds iOS app."
"echo" "-e" " ios_release"
"echo" "-e" " Builds iOS app for submission to Apple appstore."
"echo" "-e" " android"
"echo" "-e" " Builds android app."
"echo" "-e" " mac_desktop"
"echo" "-e" " Builds Mac OS desktop app."
"echo" "-e" " *Mac OS Desktop builds are a Pro user feature."
"echo" "-e" " windows_desktop"
"echo" "-e" " Builds Windows desktop app."
"echo" "-e" " *Windows Desktop builds are a Pro user feature."
"echo" "-e" " windows_device"
"echo" "-e" " Builds UWP Windows app."
"echo" "-e" " javascript"
"echo" "-e" " Builds as a web app."
"echo" "-e" " *Javascript builds are an Enterprise user feature"
}
function settings {
"$MVNW" "cn:settings" "-U" "-e"
}
CMD="$1"
if [ "$CMD" == "" ]; then
CMD="jar"
fi
"$CMD"