Skip to content

Commit 3cb4edc

Browse files
committed
added build configs example project
1 parent c66e8a6 commit 3cb4edc

File tree

19 files changed

+161
-0
lines changed

19 files changed

+161
-0
lines changed

Gradle Build Configs/build.gradle

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
dependencies {
6+
classpath 'com.android.tools.build:gradle:0.2'
7+
}
8+
}
9+
10+
apply plugin: 'android'
11+
12+
13+
android {
14+
target='android-16'
15+
defaultConfig {
16+
packageName='de.goddchen.android.gradle.buildconfigs'
17+
signingStoreLocation='keystore'
18+
signingStorePassword='helloworld'
19+
signingKeyAlias='Android Release Key'
20+
signingKeyPassword='helloworld'
21+
}
22+
buildTypes {
23+
release {
24+
buildConfig "public final static boolean IS_LIVE=true;"
25+
}
26+
debug {
27+
buildConfig "public final static boolean IS_LIVE=false;"
28+
}
29+
}
30+
}

Gradle Build Configs/keystore

2.17 KB
Binary file not shown.
341 KB
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To enable ProGuard in your project, edit project.properties
2+
# to define the proguard.config property as described in that file.
3+
#
4+
# Add project specific ProGuard rules here.
5+
# By default, the flags in this file are appended to flags specified
6+
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7+
# You can edit the include path and order by changing the ProGuard
8+
# include property in project.properties.
9+
#
10+
# For more details, see
11+
# http://developer.android.com/guide/developing/tools/proguard.html
12+
13+
# Add any project specific keep options here:
14+
15+
# If your project uses WebView with JS, uncomment the following
16+
# and specify the fully qualified class name to the JavaScript interface
17+
# class:
18+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19+
# public *;
20+
#}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system edit
7+
# "ant.properties", and override values to adapt the script to your
8+
# project structure.
9+
#
10+
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11+
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12+
13+
# Project target.
14+
target=android-16
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="de.goddchen.android.gradle.helloworld"
3+
android:versionCode="1"
4+
android:versionName="1.0" >
5+
6+
<uses-sdk
7+
android:minSdkVersion="8"
8+
android:targetSdkVersion="15" />
9+
10+
<application
11+
android:icon="@drawable/ic_launcher"
12+
android:label="@string/app_name"
13+
android:theme="@style/AppTheme" >
14+
<activity
15+
android:name=".MainActivity"
16+
android:label="@string/title_activity_main" >
17+
<intent-filter>
18+
<action android:name="android.intent.action.MAIN" />
19+
20+
<category android:name="android.intent.category.LAUNCHER" />
21+
</intent-filter>
22+
</activity>
23+
</application>
24+
25+
</manifest>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package de.goddchen.android.gradle.helloworld;
2+
3+
import de.goddchen.android.gradle.helloworld.R;
4+
import de.goddchen.android.gradle.helloworld.BuildConfig;
5+
import android.app.Activity;
6+
import android.os.Bundle;
7+
import android.view.Menu;
8+
import android.widget.TextView;
9+
10+
public class MainActivity extends Activity {
11+
12+
@Override
13+
public void onCreate(Bundle savedInstanceState) {
14+
super.onCreate(savedInstanceState);
15+
setContentView(R.layout.activity_main);
16+
((TextView)findViewById(R.id.releasemode)).setText("Release Mode: " + (BuildConfig.IS_LIVE ? "live" : "dev"));
17+
}
18+
19+
@Override
20+
public boolean onCreateOptionsMenu(Menu menu) {
21+
getMenuInflater().inflate(R.menu.activity_main, menu);
22+
return true;
23+
}
24+
}
3.05 KB
Loading
9.18 KB
Loading
2.96 KB
Loading

0 commit comments

Comments
 (0)