mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-09 05:24:44 +01:00
more gradle improvements. Seems to build a usable .apk, but isn't
doing release/debug right yet.
This commit is contained in:
parent
7aff11d7b0
commit
9f28e5c350
4 changed files with 78 additions and 14 deletions
|
@ -53,6 +53,7 @@ android {
|
||||||
res.srcDirs "src/${dir}/res"
|
res.srcDirs "src/${dir}/res"
|
||||||
}
|
}
|
||||||
manifest.srcFile 'AndroidManifest.xml'
|
manifest.srcFile 'AndroidManifest.xml'
|
||||||
|
java.srcDirs = ['src']
|
||||||
assets.srcDirs = ['assets']
|
assets.srcDirs = ['assets']
|
||||||
res.srcDirs = ['res']
|
res.srcDirs = ['res']
|
||||||
jniLibs.srcDir 'libs' // use the jni .so compiled from the manual ndk-build command
|
jniLibs.srcDir 'libs' // use the jni .so compiled from the manual ndk-build command
|
||||||
|
@ -65,6 +66,25 @@ android {
|
||||||
lintOptions {
|
lintOptions {
|
||||||
abortOnError false
|
abortOnError false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
String password = System.getenv("KEYSTORE_PASSWORD")
|
||||||
|
if (null == password || ''.equals(password)) {
|
||||||
|
password = new String(System.console().readPassword("\n\$ Enter keystore password: "))
|
||||||
|
}
|
||||||
|
storePassword password
|
||||||
|
keyPassword password
|
||||||
|
storeFile "${System.properties['user.home']}${File.separator}.keystore" as File
|
||||||
|
keyAlias 'mykey'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task genVers(type: Exec) {
|
task genVers(type: Exec) {
|
||||||
|
@ -83,7 +103,18 @@ task copyStrings(type: Exec) {
|
||||||
commandLine '../scripts/copy-strings.py'
|
commandLine '../scripts/copy-strings.py'
|
||||||
}
|
}
|
||||||
|
|
||||||
task myPreBuild(dependsOn: ['genVers', 'mkImages', 'copyStrings']) {
|
task ndkSetup(type: Exec) {
|
||||||
|
commandLine "../scripts/ndksetup.sh"
|
||||||
|
}
|
||||||
|
|
||||||
|
task genGcmid(type: Exec) {
|
||||||
|
commandLine '../scripts/gen_gcmid.sh',
|
||||||
|
'-o', "src/org/eehouse/android/$VARIANT_NAME/GCMConsts.java",
|
||||||
|
'-v', "$VARIANT_NAME"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
task myPreBuild(dependsOn: ['genVers', 'ndkSetup', 'mkImages', 'copyStrings', 'mkXml', 'genGcmid']) {
|
||||||
}
|
}
|
||||||
|
|
||||||
task ndkBuild(type: Exec) {
|
task ndkBuild(type: Exec) {
|
||||||
|
@ -92,9 +123,14 @@ task ndkBuild(type: Exec) {
|
||||||
"INITIAL_CLIENT_VERS=$INITIAL_CLIENT_VERS", "VARIANT=$VARIANT_NAME", 'V=1'
|
"INITIAL_CLIENT_VERS=$INITIAL_CLIENT_VERS", "VARIANT=$VARIANT_NAME", 'V=1'
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
task mkXml(type: Exec) {
|
||||||
compileTask -> compileTask.dependsOn myPreBuild
|
commandLine '../scripts/mk_xml.py', '-o',
|
||||||
|
"src/org/eehouse/android/$VARIANT_NAME/loc/LocIDsData.java",
|
||||||
|
'-t', "debug", '-v', "$VARIANT_NAME"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
preBuild.dependsOn myPreBuild
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
compileTask -> compileTask.dependsOn ndkBuild
|
compileTask -> compileTask.dependsOn ndkBuild
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,9 +59,11 @@
|
||||||
</exec>
|
</exec>
|
||||||
|
|
||||||
<exec dir="." executable="../scripts/gen_gcmid.sh"
|
<exec dir="." executable="../scripts/gen_gcmid.sh"
|
||||||
output="src/org/eehouse/android/${VARIANT_NAME}/GCMConsts.java"
|
|
||||||
logError="true" failonerror="true"
|
logError="true" failonerror="true"
|
||||||
>
|
>
|
||||||
|
<arg value="-o"/>
|
||||||
|
<arg value="src/org/eehouse/android/${VARIANT_NAME}/GCMConsts.java"/>
|
||||||
|
<arg value="-v"/>
|
||||||
<arg value="${VARIANT_NAME}"/>
|
<arg value="${VARIANT_NAME}"/>
|
||||||
</exec>
|
</exec>
|
||||||
<exec dir="." executable="../scripts/genvers.sh" output="/dev/null"
|
<exec dir="." executable="../scripts/genvers.sh" output="/dev/null"
|
||||||
|
|
|
@ -4,6 +4,31 @@ set -e -u
|
||||||
|
|
||||||
GCM_SENDER_ID=${GCM_SENDER_ID:-""}
|
GCM_SENDER_ID=${GCM_SENDER_ID:-""}
|
||||||
CRITTERCISM_APP_ID=${CRITTERCISM_APP_ID:-""}
|
CRITTERCISM_APP_ID=${CRITTERCISM_APP_ID:-""}
|
||||||
|
OUTFILE=""
|
||||||
|
VARIANT=""
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "usage: $0 -o outfile -v <variant>"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case $1 in
|
||||||
|
-o)
|
||||||
|
OUTFILE=$2
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-v)
|
||||||
|
VARIANT=$2
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "unexpected param $1"
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
if [ -z "$GCM_SENDER_ID" ]; then
|
if [ -z "$GCM_SENDER_ID" ]; then
|
||||||
echo "GCM_SENDER_ID empty; GCM use will be disabled" >&2
|
echo "GCM_SENDER_ID empty; GCM use will be disabled" >&2
|
||||||
|
@ -12,9 +37,12 @@ if [ -z "$CRITTERCISM_APP_ID" ]; then
|
||||||
echo "CRITTERCISM_APP_ID empty; Crittercism will not be enabled" >&2
|
echo "CRITTERCISM_APP_ID empty; Crittercism will not be enabled" >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PKG=$1
|
[ -z "$VARIANT" ] && usage
|
||||||
|
[ -z "$OUTFILE" ] && usage
|
||||||
|
|
||||||
cat <<EOF
|
PKG=$VARIANT
|
||||||
|
|
||||||
|
cat <<EOF > $OUTFILE
|
||||||
// Auto-generated: DO NOT CHECK THIS IN until questions about
|
// Auto-generated: DO NOT CHECK THIS IN until questions about
|
||||||
// obscuring various ids are cleared up. For now they're not meant
|
// obscuring various ids are cleared up. For now they're not meant
|
||||||
// to be committed to public repos.
|
// to be committed to public repos.
|
||||||
|
|
|
@ -9,9 +9,7 @@ XWORDS_DEBUG_X86ONLY=${XWORDS_DEBUG_X86ONLYx:-""}
|
||||||
|
|
||||||
echo "# Generated by $0; do not edit!!!" > $TMP_MK
|
echo "# Generated by $0; do not edit!!!" > $TMP_MK
|
||||||
|
|
||||||
if [ "$1" = "release" ]; then
|
if [ -n "$XWORDS_DEBUG_ARMONLY" ]; then
|
||||||
echo "APP_ABI := armeabi x86" >> $TMP_MK
|
|
||||||
elif [ -n "$XWORDS_DEBUG_ARMONLY" ]; then
|
|
||||||
echo "APP_ABI := armeabi" >> $TMP_MK
|
echo "APP_ABI := armeabi" >> $TMP_MK
|
||||||
elif [ -n "$XWORDS_DEBUG_X86ONLY" ]; then
|
elif [ -n "$XWORDS_DEBUG_X86ONLY" ]; then
|
||||||
echo "APP_ABI := x86" >> $TMP_MK
|
echo "APP_ABI := x86" >> $TMP_MK
|
||||||
|
|
Loading…
Reference in a new issue