Last active
December 2, 2015 15:26
-
-
Save litefeel/41351dff917e5f984080 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
dependencies { | |
compile fileTree(dir: 'libs', include: '*.jar') | |
// compile sdk | |
compile project(':sdks:sdk1') | |
compile project(':sdks:sdk2') | |
} | |
android { | |
compileSdkVersion 19 | |
buildToolsVersion "23.0.1" | |
compileOptions { | |
sourceCompatibility JavaVersion.VERSION_1_7 | |
targetCompatibility JavaVersion.VERSION_1_7 | |
} | |
defaultConfig { | |
minSdkVersion 10 | |
targetSdkVersion 19 | |
} | |
signingConfigs { | |
myConfig { | |
storeFile file('../keystore/andorid.keystore') | |
storePassword '123456' | |
keyAlias 'android_keystore' | |
keyPassword '123456' | |
} | |
} | |
buildTypes { | |
release { | |
signingConfig signingConfigs.myConfig | |
} | |
} | |
// change output apk name and path | |
applicationVariants.all { variant -> | |
variant.outputs.each { output -> | |
def file = output.outputFile | |
if (!file.name.endsWith("-unaligned.apk")) { | |
output.outputFile = new File("F:/release/vn", file.name.toLowerCase().replace('tetris', 'android-tetris')) | |
} | |
} | |
} | |
sourceSets { | |
main { | |
manifest.srcFile 'AndroidManifest.xml' | |
java.srcDirs = ['src'] | |
resources.srcDirs = ['src'] | |
aidl.srcDirs = ['src'] | |
renderscript.srcDirs = ['src'] | |
res.srcDirs = ['res'] | |
assets.srcDirs = ['assets'] | |
} | |
// Move the tests to tests/java, tests/res, etc... | |
instrumentTest.setRoot('tests') | |
// Move the build types to build-types/<type> | |
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ... | |
// This moves them out of them default location under src/<type>/... which would | |
// conflict with src/ being used by the main source set. | |
// Adding new build types or product flavors should be accompanied | |
// by a similar customization. | |
debug.setRoot('build-types/debug') | |
release.setRoot('build-types/release') | |
} | |
lintOptions { | |
abortOnError false | |
} | |
} | |
task copyMyAssets(type: Copy) { | |
from '../Resources' | |
into 'src/assets' | |
include 'system.ini' | |
} | |
preBuild.dependsOn copyMyAssets | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.library' | |
dependencies { | |
compile fileTree(dir: 'libs', include: '*.jar') | |
} | |
android { | |
compileSdkVersion 19 | |
buildToolsVersion "23.0.1" | |
sourceSets { | |
main { | |
manifest.srcFile 'AndroidManifest.xml' | |
java.srcDirs = ['src'] | |
resources.srcDirs = ['src'] | |
aidl.srcDirs = ['src'] | |
renderscript.srcDirs = ['src'] | |
res.srcDirs = ['res'] | |
jniLibs.srcDirs = ['libs'] | |
assets.srcDirs = ["assets"] | |
// assets.excludes don't work | |
//assets.excludes = ['**/sound/**'] | |
} | |
// Move the tests to tests/java, tests/res, etc... | |
instrumentTest.setRoot('tests') | |
// Move the build types to build-types/<type> | |
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ... | |
// This moves them out of them default location under src/<type>/... which would | |
// conflict with src/ being used by the main source set. | |
// Adding new build types or product flavors should be accompanied | |
// by a similar customization. | |
debug.setRoot('build-types/debug') | |
release.setRoot('build-types/release') | |
} | |
} | |
// remove sound dictionary | |
android.libraryVariants.all { variant -> | |
// | |
def removeSomeAssets = task("delete_${variant.buildType.name}_sound", type: Delete) { | |
delete "${buildDir}/intermediates/bundles/${variant.buildType.name}/assets/sound/" | |
} | |
tasks.each { task -> | |
//println "android task: $task.name" | |
// mergeReleaseAssets | |
if (task.name.contains('merge')) { | |
task.finalizedBy removeSomeAssets | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include ':libcocos2dx' | |
project(':libcocos2dx').projectDir = new File(settingsDir, '../cocos2d/cocos/platform/android/libcocos2dx') | |
include ':tetris' | |
project(':tetris').projectDir = new File(settingsDir, 'app') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment