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

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
# User-specific configurations
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="1.8" />
<option name="modules">
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<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" />
\ 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 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 `` 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
./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.*
# 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:
# '' 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.
apply plugin: ''
android {
compileSdkVersion 10
buildToolsVersion "23.0.2"
defaultConfig {
applicationId ""
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 ''
<?xml version="1.0" encoding="UTF-8"?>
<project name="Stardroid" default="help">
<!-- Despite the warning below, you will need to add the following to if you want to run ant release and get a signed build
(otherwise the build will be unsigned):
key.alias.password=(secret) keystore directory)
<!-- The 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="" />
<!-- The 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:
The name of the source directory. Default is 'src'.
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="" />
<!-- The 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
(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="" />
<!-- quick check on sdk.dir -->
message="sdk.dir is missing. Make sure to generate using 'android update project'"
<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<target name="-pre-build">
<target name="-pre-compile">
/* 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">
<!-- 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" />
# 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
# 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
# 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,
# "", and override values to adapt the script to your
# project structure.
# Project target.
import android.test.ApplicationTestCase;
* <a href="">Testing Fundamentals</a>
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment