| 1 |
def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY'); |
| 2 |
def buildAsApplication = !buildAsLibrary |
| 3 |
if (buildAsApplication) { |
| 4 |
apply plugin: 'com.android.application' |
| 5 |
} |
| 6 |
else { |
| 7 |
apply plugin: 'com.android.library' |
| 8 |
} |
| 9 |
|
| 10 |
android { |
| 11 |
if (buildAsApplication) { |
| 12 |
namespace "org.tildearrow.furnace" |
| 13 |
} |
| 14 |
compileSdkVersion 26 |
| 15 |
defaultConfig { |
| 16 |
minSdkVersion 21 |
| 17 |
targetSdkVersion 26 |
| 18 |
versionCode 228 |
| 19 |
versionName "0.6.8.1" |
| 20 |
externalNativeBuild { |
| 21 |
cmake { |
| 22 |
arguments "-DANDROID_APP_PLATFORM=android-21", "-DANDROID_STL=c++_static", "-DWARNINGS_ARE_ERRORS=ON", "-DWITH_LOCALE=ON", "-DUSE_MOMO=ON" |
| 23 |
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' |
| 24 |
abiFilters 'arm64-v8a' |
| 25 |
} |
| 26 |
} |
| 27 |
} |
| 28 |
buildTypes { |
| 29 |
release { |
| 30 |
minifyEnabled false |
| 31 |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 32 |
} |
| 33 |
} |
| 34 |
applicationVariants.all { variant -> |
| 35 |
tasks["merge${variant.name.capitalize()}Assets"] |
| 36 |
.dependsOn("externalNativeBuild${variant.name.capitalize()}") |
| 37 |
} |
| 38 |
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) { |
| 39 |
sourceSets.main { |
| 40 |
jniLibs.srcDir 'libs' |
| 41 |
} |
| 42 |
externalNativeBuild { |
| 43 |
cmake { |
| 44 |
path 'jni/CMakeLists.txt' |
| 45 |
} |
| 46 |
} |
| 47 |
|
| 48 |
} |
| 49 |
lint { |
| 50 |
abortOnError false |
| 51 |
} |
| 52 |
|
| 53 |
if (buildAsLibrary) { |
| 54 |
libraryVariants.all { variant -> |
| 55 |
variant.outputs.each { output -> |
| 56 |
def outputFile = output.outputFile |
| 57 |
if (outputFile != null && outputFile.name.endsWith(".aar")) { |
| 58 |
def fileName = "org.libsdl.app.aar"; |
| 59 |
output.outputFile = new File(outputFile.parent, fileName); |
| 60 |
} |
| 61 |
} |
| 62 |
} |
| 63 |
} |
| 64 |
} |
| 65 |
|
| 66 |
dependencies { |
| 67 |
implementation fileTree(include: ['*.jar'], dir: 'libs') |
| 68 |
} |