Skip to content

Commit 7b08b4d

Browse files
committed
v0.9.4: added iOS module!
Note that this commit includes several changes made iteratively over time, from TestFlight 1.0 to 1.5
1 parent 0c2434a commit 7b08b4d

29 files changed

+729
-1
lines changed

build.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ buildscript {
55
}
66
dependencies {
77
classpath 'com.android.tools.build:gradle:4.2.1'
8+
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.13'
89
}
910
}
1011

@@ -24,12 +25,14 @@ allprojects {
2425
appAndroidTargetSDK = 30
2526

2627
gdxVersion = '1.10.0'
28+
robovmVersion = '2.3.13'
2729
}
2830
version = appVersionName
2931

3032
repositories {
3133
google()
3234
mavenCentral()
35+
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
3336
}
3437

3538
}

ios/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#RoboVM build folders
2+
robovm-build/
3+
4+
#RoboVM config (we dynamically generate it)
5+
robovm.properties

ios/Info.plist

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>${appName}</string>
9+
<key>CFBundleExecutable</key>
10+
<string>${appExecutable}</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>${appPackageName}</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>${appName}</string>
17+
<key>CFBundlePackageType</key>
18+
<string>APPL</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>${appShortVersionName}</string>
21+
<key>CFBundleVersionString</key>
22+
<string>${appVersionName}</string>
23+
<key>CFBundleVersion</key>
24+
<string>${appVersionCode}</string>
25+
<key>LSRequiresIPhoneOS</key>
26+
<true/>
27+
<key>UIStatusBarHidden</key>
28+
<false/>
29+
<key>UIViewControllerBasedStatusBarAppearance</key>
30+
<false/>
31+
<key>UIStatusBarStyle</key>
32+
<string>UIStatusBarStyleLightContent</string>
33+
<key>MinimumOSVersion</key>
34+
<string>9.0</string>
35+
<key>UIDeviceFamily</key>
36+
<array>
37+
<integer>1</integer>
38+
<integer>2</integer>
39+
</array>
40+
<key>UIRequiredDeviceCapabilities</key>
41+
<array>
42+
<string>opengles-2</string>
43+
</array>
44+
<key>UISupportedInterfaceOrientations</key>
45+
<array>
46+
<string>UIInterfaceOrientationPortrait</string>
47+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
48+
<string>UIInterfaceOrientationLandscapeLeft</string>
49+
<string>UIInterfaceOrientationLandscapeRight</string>
50+
</array>
51+
<key>UILaunchStoryboardName</key>
52+
<string>LaunchScreen</string>
53+
<key>UIRequiresFullScreen</key>
54+
<true/>
55+
<key>CFBundleIconName</key>
56+
<string>AppIcon</string>
57+
<key>ITSAppUsesNonExemptEncryption</key>
58+
<false/>
59+
</dict>
60+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "[email protected]",
5+
"idiom" : "iphone",
6+
"scale" : "2x",
7+
"size" : "20x20"
8+
},
9+
{
10+
"filename" : "[email protected]",
11+
"idiom" : "iphone",
12+
"scale" : "3x",
13+
"size" : "20x20"
14+
},
15+
{
16+
"filename" : "[email protected]",
17+
"idiom" : "iphone",
18+
"scale" : "2x",
19+
"size" : "29x29"
20+
},
21+
{
22+
"filename" : "[email protected]",
23+
"idiom" : "iphone",
24+
"scale" : "3x",
25+
"size" : "29x29"
26+
},
27+
{
28+
"filename" : "[email protected]",
29+
"idiom" : "iphone",
30+
"scale" : "2x",
31+
"size" : "40x40"
32+
},
33+
{
34+
"filename" : "[email protected]",
35+
"idiom" : "iphone",
36+
"scale" : "3x",
37+
"size" : "40x40"
38+
},
39+
{
40+
"filename" : "[email protected]",
41+
"idiom" : "iphone",
42+
"scale" : "2x",
43+
"size" : "60x60"
44+
},
45+
{
46+
"filename" : "[email protected]",
47+
"idiom" : "iphone",
48+
"scale" : "3x",
49+
"size" : "60x60"
50+
},
51+
{
52+
"filename" : "Icon-20.png",
53+
"idiom" : "ipad",
54+
"scale" : "1x",
55+
"size" : "20x20"
56+
},
57+
{
58+
"filename" : "[email protected]",
59+
"idiom" : "ipad",
60+
"scale" : "2x",
61+
"size" : "20x20"
62+
},
63+
{
64+
"filename" : "Icon-29.png",
65+
"idiom" : "ipad",
66+
"scale" : "1x",
67+
"size" : "29x29"
68+
},
69+
{
70+
"filename" : "[email protected]",
71+
"idiom" : "ipad",
72+
"scale" : "2x",
73+
"size" : "29x29"
74+
},
75+
{
76+
"filename" : "Icon-40.png",
77+
"idiom" : "ipad",
78+
"scale" : "1x",
79+
"size" : "40x40"
80+
},
81+
{
82+
"filename" : "[email protected]",
83+
"idiom" : "ipad",
84+
"scale" : "2x",
85+
"size" : "40x40"
86+
},
87+
{
88+
"filename" : "Icon-76.png",
89+
"idiom" : "ipad",
90+
"scale" : "1x",
91+
"size" : "76x76"
92+
},
93+
{
94+
"filename" : "[email protected]",
95+
"idiom" : "ipad",
96+
"scale" : "2x",
97+
"size" : "76x76"
98+
},
99+
{
100+
"filename" : "[email protected]",
101+
"idiom" : "ipad",
102+
"scale" : "2x",
103+
"size" : "83.5x83.5"
104+
},
105+
{
106+
"filename" : "Icon-1024.png",
107+
"idiom" : "ios-marketing",
108+
"scale" : "1x",
109+
"size" : "1024x1024"
110+
},
111+
{
112+
"idiom" : "mac",
113+
"scale" : "1x",
114+
"size" : "16x16"
115+
},
116+
{
117+
"idiom" : "mac",
118+
"scale" : "2x",
119+
"size" : "16x16"
120+
},
121+
{
122+
"idiom" : "mac",
123+
"scale" : "1x",
124+
"size" : "32x32"
125+
},
126+
{
127+
"idiom" : "mac",
128+
"scale" : "2x",
129+
"size" : "32x32"
130+
},
131+
{
132+
"idiom" : "mac",
133+
"scale" : "1x",
134+
"size" : "128x128"
135+
},
136+
{
137+
"idiom" : "mac",
138+
"scale" : "2x",
139+
"size" : "128x128"
140+
},
141+
{
142+
"idiom" : "mac",
143+
"scale" : "1x",
144+
"size" : "256x256"
145+
},
146+
{
147+
"idiom" : "mac",
148+
"scale" : "2x",
149+
"size" : "256x256"
150+
},
151+
{
152+
"idiom" : "mac",
153+
"scale" : "1x",
154+
"size" : "512x512"
155+
},
156+
{
157+
"idiom" : "mac",
158+
"scale" : "2x",
159+
"size" : "512x512"
160+
}
161+
],
162+
"info" : {
163+
"author" : "xcode",
164+
"version" : 1
165+
}
166+
}
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Banner.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "[email protected]",
10+
"idiom" : "universal",
11+
"scale" : "2x"
12+
},
13+
{
14+
"filename" : "[email protected]",
15+
"idiom" : "universal",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"author" : "xcode",
21+
"version" : 1
22+
}
23+
}

ios/assets/LaunchScreen.storyboard

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<device id="retina6_1" orientation="portrait" appearance="light"/>
4+
<dependencies>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
6+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
7+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
8+
</dependencies>
9+
<scenes>
10+
<!--View Controller-->
11+
<scene sceneID="EHf-IW-A2E">
12+
<objects>
13+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
14+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
15+
<rect key="frame" x="0.0" y="0.0" width="450" height="500"/>
16+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
17+
<subviews>
18+
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="Banner" translatesAutoresizingMaskIntoConstraints="NO" id="hN2-E0-Tu8">
19+
<rect key="frame" x="25" y="0" width="400" height="250"/>
20+
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
21+
</imageView>
22+
</subviews>
23+
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
24+
<color key="backgroundColor" white="0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
25+
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
26+
</view>
27+
<extendedEdge key="edgesForExtendedLayout"/>
28+
<nil key="simulatedTopBarMetrics"/>
29+
</viewController>
30+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
31+
</objects>
32+
<point key="canvasLocation" x="52.173913043478265" y="375"/>
33+
</scene>
34+
</scenes>
35+
<resources>
36+
<image name="Banner" width="400" height="250"/>
37+
</resources>
38+
</document>

ios/build.gradle

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
apply plugin: "java"
2+
apply plugin: "robovm"
3+
4+
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
5+
sourceCompatibility = targetCompatibility = appJavaCompatibility
6+
7+
task updateRoboVMProps(){
8+
def props = new Properties()
9+
10+
props.setProperty ('appName', appName)
11+
//append .apple because com.shatteredpixel.shatteredpixeldungeon was taken =(
12+
props.setProperty ('appPackageName', appPackageName + ".apple")
13+
14+
props.setProperty ('appVersionCode', appVersionCode.toString())
15+
props.setProperty ('appVersionName', appVersionName)
16+
//parse out just #.#.# from version name, this is an apple requirement
17+
props.setProperty ('appShortVersionName', (appVersionName =~ /\d+\.\d+\.\d+/)[0])
18+
19+
props.setProperty ('appMainclass', "com.shatteredpixel.shatteredpixeldungeon.ios.IOSLauncher")
20+
props.setProperty ('appExecutable', "IOSLauncher")
21+
22+
file("robovm.properties").withWriter { props.store(it, "Dynamically generated, do not commit to version control!") }
23+
}
24+
25+
build.dependsOn updateRoboVMProps
26+
27+
launchIPhoneSimulator.dependsOn build
28+
launchIPadSimulator.dependsOn build
29+
launchIOSDevice.dependsOn build
30+
createIPA.dependsOn build
31+
32+
dependencies {
33+
implementation project(':core')
34+
implementation project(':services:updates:debugUpdates')
35+
implementation project(':services:news:shatteredNews')
36+
37+
implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
38+
implementation "com.mobidevelop.robovm:robovm-rt:$robovmVersion"
39+
implementation "com.mobidevelop.robovm:robovm-cocoatouch:$robovmVersion"
40+
implementation "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
41+
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
42+
implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
43+
}

0 commit comments

Comments
 (0)