1 apply plugin: 'android'
4 compile fileTree(include: '*.jar', dir: 'libs')
5 compile project(':GLWallpaperService')
10 buildToolsVersion "21.1.2"
12 sourceCompatibility JavaVersion.VERSION_1_7
13 targetCompatibility JavaVersion.VERSION_1_7
17 manifest.srcFile 'AndroidManifest.xml'
18 java.srcDirs = ['src']
19 resources.srcDirs = ['src']
20 aidl.srcDirs = ['src']
21 renderscript.srcDirs = ['src']
23 assets.srcDirs = ['assets']
24 // jniLibs.srcDirs = ['jni']
25 jniLibs.srcDirs = ['libs']
26 jni.srcDirs = [] // disable automatic ndk-build call
29 // Move the tests to tests/java, tests/res, etc...
30 instrumentTest.setRoot('tests')
32 // Move the build types to build-types/<type>
33 // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
34 // This moves them out of them default location under src/<type>/... which would
35 // conflict with src/ being used by the main source set.
36 // Adding new build types or product flavors should be accompanied
37 // by a similar customization.
38 debug.setRoot('build-types/debug')
39 release.setRoot('build-types/release')
41 project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'mips': 5, 'mips64': 6, 'x86': 8, 'x86_64': 9]
42 //versionCode digit for each supported ABI, with 64bit>32bit and x86>armeabi-*
45 // put ndk-build in build's path, or replace below with its full path
46 task ndkBuild(type: Exec) {
47 Properties properties = new Properties()
48 properties.load(project.rootProject.file('local.properties').newDataInputStream())
49 def ndkDir = properties.getProperty('ndk.dir')
50 commandLine "$ndkDir/ndk-build", '-C', file('jni').absolutePath
53 // generate files early in the process
54 task perlBuild(type: Exec) {
55 commandLine 'perl', '-x../..', '../../generate_files.pl', 'sproingies', 'superquadrics', 'stonerview', 'unknownpleasures', 'bouncingcow', 'hypertorus', 'glhanoi'
59 task perlClean(type: Exec) {
60 commandLine 'rm', '-f', '../../gen/glue.c', './res/values/items.xml', './res/values/strings.xml', './res/values/settings.xml'
63 task perlCleaner(type: Exec) {
64 commandLine 'rm', '-rf', './res/xml', './src/org/jwz/xscreensaver/gen'
67 task objlibClean(type: Exec) {
68 commandLine 'rm', '-rf', './obj/local', './libs/armeabi', './libs/armeabi-v7a', './libs/mips', './libs/x86'
72 // if perlBuild already generated file, do not run perlBuild again
73 if (! file("../../gen/glue.c").exists()) {
74 preBuild.dependsOn perlBuild
77 clean.dependsOn perlClean
78 clean.dependsOn perlCleaner
79 clean.dependsOn objlibClean
82 tasks.withType(JavaCompile) {
83 compileTask -> compileTask.dependsOn ndkBuild