Commit 5f79d39e authored by John Taylor's avatar John Taylor

First stage of switching from Ant to Gradle. Creates gradle files and moves...

First stage of switching from Ant to Gradle.  Creates gradle files and moves the app files to the correct location.  Note that at present the built app will crash due to a mismatch in the string ids that are now generated vs those long baked into the data files.
parent 8614bd90
.gradle
/local.properties
# User-specific configurations
.idea/libraries/
.idea/workspace.xml
.idea/tasks.xml
.idea/.name
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/encodings.xml
.idea/misc.xml
.idea/modules.xml
.idea/scopes/scope_settings.xml
.idea/vcs.xml
*.iml
/.idea/libraries
.DS_Store
/build
/captures
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="1.8" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
......@@ -4,18 +4,39 @@ three directories:
* test: Testing source (woefully out of date)
* tools: Source for generating binary data used by the app.
To build SkyMap, you need to have install 'ant' and have downloaded a
version of the Android SDK. Then, change to the app directory and create a
local.properties file containing the location of your Android SDK. It
should have a single line that looks like this:
sdk.dir=<Path to your SDK>
To build SkyMap, you can use Android Developer Studio or Gradle. Begin by
by creating a `local.properties` file containing the location of your
Android installation:
A quick way to generate it is using the Android tool. From the `app` directory:
sdk.dir=<path to your SDK>
android update project --target 1 --path .
Android Developer Studio can create this for you.
Executing 'ant clean debug' will build the binary. It will be located in
the bin directory and will be named Stardroid-debug.apk. Make sure that
your device can handle binaries that don't come from the market, and you
should be good to go.
## Building a debug apk
From the root directory execute
./gradlew assembleDebug
The apk can be found in `app/build/outputs/apk/`.
## Building a release apk
(Sky Map team only)
Set the following environment variables:
export KEYPWD=<the key password>
export KSTOREPWD=<the key store password>
From the root directory execute
./gradlew assemble
or
./gradlew assembleRelease
The apk can be found in `app/build/outputs/apk/`.
*Note - at present the app built with these instructions will crash due to a mismatch between the R file and the strings constants in the data files. Fix coming soon.*
bin/
build/
gen/
local.properties
stardroid-release-key.keystore
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
key.alias=stardroid
application.package=com.google.android.stardroid
source.dir=src
out.dir=bin
key.store=stardroid-release-key.keystore
apply plugin: 'com.android.application'
android {
compileSdkVersion 10
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.google.android.stardroid"
minSdkVersion 3
targetSdkVersion 23
versionCode 1113
versionName "1.6.5"
}
signingConfigs {
release {
storeFile file("stardroid-release-key.keystore")
storePassword System.getenv("KSTOREPWD")
keyPassword System.getenv("KEYPWD")
keyAlias "stardroid"
}
}
buildTypes {
release {
minifyEnabled false
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
}
}
lintOptions {
// Lint complains because of missing translations.
// TODO(jontayler): fix the missing translations.
abortOnError false
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
//compile 'com.android.support:appcompat-v7:23.1.1'
}
<?xml version="1.0" encoding="UTF-8"?>
<project name="Stardroid" default="help">
<!-- Despite the warning below, you will need to add the following to
local.properties if you want to run ant release and get a signed build
(otherwise the build will be unsigned):
key.store.password=(secret)
key.alias.password=(secret)
key.store=(your keystore directory)
-->
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<loadproperties srcFile="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
unless="sdk.dir"
/>
<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<!--
<target name="-pre-build">
</target>
<target name="-pre-compile">
</target>
/* This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir} */
<target name="-post-compile">
</target>
-->
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/johntaylor/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
......
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-15
package stardroid.android.google.com;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
\ No newline at end of file