Skip to content

Commit d304bd3

Browse files
committed
Build enhancements + lint fixes
1 parent 1e6fac3 commit d304bd3

File tree

7 files changed

+63
-9
lines changed

7 files changed

+63
-9
lines changed

build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ android {
2323

2424
buildToolsVersion "19.1.0"
2525

26+
lintOptions {
27+
enable 'UnusedIds', 'EasterEgg' //, 'NewerVersionAvailable'
28+
}
29+
30+
apply from: 'sign.gradle'
2631
}
2732

2833

220 KB
Binary file not shown.

sign.gradle

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
final Console console = System.console();
2+
3+
if (console != null) {
4+
5+
android.signingConfigs {
6+
release {
7+
project.ext.keyStorePath = System.getenv("ANDROID_KEYSTORE")
8+
if( project.keyStorePath != null )
9+
{
10+
storeFile file( keyStorePath )
11+
keyAlias System.getenv("ANDROID_KEY_ALIAS")
12+
}
13+
storePassword "password"
14+
keyPassword "password"
15+
}
16+
}
17+
18+
task askForPasswords << {
19+
// Must create String because System.readPassword() returns char[]
20+
// (and assigning that below fails silently)
21+
def storePw = new String(System.console().readPassword("\nKeystore password: "))
22+
def keyPw = new String(System.console().readPassword("Key password: "))
23+
24+
android.signingConfigs.release.storePassword = storePw
25+
android.signingConfigs.release.keyPassword = keyPw
26+
}
27+
28+
tasks.whenTaskAdded { theTask ->
29+
if (theTask.name.equals("packageRelease")) {
30+
theTask.dependsOn "askForPasswords"
31+
}
32+
}
33+
34+
android.buildTypes {
35+
release {
36+
signingConfig android.signingConfigs.release
37+
}
38+
}
39+
} else {
40+
41+
// Building from IDE's "Run" button
42+
android.signingConfigs {
43+
release {
44+
45+
}
46+
}
47+
48+
}
49+

src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
android:versionCode="3"
4-
android:versionName="1.2"
3+
android:versionCode="6"
4+
android:versionName="1.3.2"
55

66
package="org.androidsoft.games.puzzle.kids">
77
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="19"/>

src/main/res/layout-land/main.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515
android:layout_height="wrap_content"
1616
android:contentDescription="@string/image_splash"
1717
android:gravity="center" />
18-
<TextView android:id="@+id/text"
19-
android:layout_width="fill_parent"
18+
<TextView android:layout_width="fill_parent"
2019
android:layout_height="wrap_content"
2120
android:gravity="center_horizontal|center_vertical"
2221
android:layout_marginBottom="10dp"
23-
android:text="@+string/version" />
22+
android:text="@string/version" />
2423
<Button android:id="@+id/button_play"
2524
android:layout_width="fill_parent"
2625
android:layout_height="wrap_content"

src/main/res/layout/main.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
android:layout_width="fill_parent"
1616
android:layout_height="wrap_content"
1717
android:gravity="center" />
18-
<TextView android:id="@+id/text"
19-
android:layout_width="fill_parent"
18+
<TextView android:layout_width="fill_parent"
2019
android:layout_height="wrap_content"
2120
android:gravity="center_horizontal|center_vertical"
22-
android:layout_marginBottom="10dp" />
21+
android:layout_marginBottom="10dp"
22+
android:text="@string/version" />
2323
<Button android:id="@+id/button_play"
2424
android:layout_width="fill_parent"
2525
android:layout_height="wrap_content"

src/main/res/values/strings.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<resources>
33
<string name="app_name">"Puzzle"</string>
44
<string name="activity_title">"Cheer Bear Puzzle"</string>
5+
<string name="version">"Version 1.3.2"</string>
56
<string name="success">"Congratulations, That's done !"</string>
67
<string name="new_game">"New game"</string>
78
<string name="quit">"Quit"</string>
@@ -20,7 +21,7 @@
2021

2122
<string name="credits_menu">About</string>
2223
<string name="credits_app_name">Cheer Bear Puzzle</string>
23-
<string name="credits_current_version">Version 1.2.0</string>
24+
<string name="credits_current_version">Version 1.3.2</string>
2425

2526
<string name="image_splash">Splash screen logo</string>
2627
<string name="image_other_logo">Other logo</string>

0 commit comments

Comments
 (0)