mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-14 02:36:51 -07:00
Grep Android Version from CMake
This commit is contained in:
parent
6c8b8c458b
commit
5d8ce70ff7
4 changed files with 22 additions and 4 deletions
2
android/.gitignore
vendored
2
android/.gitignore
vendored
|
@ -12,3 +12,5 @@
|
||||||
/captures
|
/captures
|
||||||
.externalNativeBuild
|
.externalNativeBuild
|
||||||
.cxx
|
.cxx
|
||||||
|
/app/release
|
||||||
|
keystore.jks
|
||||||
|
|
|
@ -3,6 +3,20 @@ apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlin-android-extensions'
|
apply plugin: 'kotlin-android-extensions'
|
||||||
apply plugin: 'kotlin-kapt'
|
apply plugin: 'kotlin-kapt'
|
||||||
|
|
||||||
|
def rootCMakeLists = "../../CMakeLists.txt"
|
||||||
|
def rootCMakeListsContent = file(rootCMakeLists).text
|
||||||
|
static def grepVersionComponent(content, varname) {
|
||||||
|
def match = content =~ /set\($varname ([0-9]+)\)/
|
||||||
|
if(!match.find())
|
||||||
|
throw new GradleException("Failed to find $varname in CMakeLists.txt")
|
||||||
|
return match.group(1)
|
||||||
|
}
|
||||||
|
def chiakiVersionMajor = grepVersionComponent(rootCMakeListsContent, "CHIAKI_VERSION_MAJOR")
|
||||||
|
def chiakiVersionMinor = grepVersionComponent(rootCMakeListsContent, "CHIAKI_VERSION_MINOR")
|
||||||
|
def chiakiVersionPatch = grepVersionComponent(rootCMakeListsContent, "CHIAKI_VERSION_PATCH")
|
||||||
|
def chiakiVersion = "$chiakiVersionMajor.$chiakiVersionMinor.$chiakiVersionPatch"
|
||||||
|
println("Determined Chiaki Version: $chiakiVersion")
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
buildToolsVersion "29.0.2"
|
buildToolsVersion "29.0.2"
|
||||||
|
@ -11,7 +25,7 @@ android {
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName chiakiVersion
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
arguments "-DCHIAKI_ENABLE_TESTS=OFF",
|
arguments "-DCHIAKI_ENABLE_TESTS=OFF",
|
||||||
|
@ -26,12 +40,12 @@ android {
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
version "3.10.2+"
|
version "3.10.2+"
|
||||||
path "../../CMakeLists.txt"
|
path rootCMakeLists
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
android/app/proguard-rules.pro
vendored
2
android/app/proguard-rules.pro
vendored
|
@ -19,3 +19,5 @@
|
||||||
# If you keep the line number information, uncomment this to
|
# If you keep the line number information, uncomment this to
|
||||||
# hide the original source file name.
|
# hide the original source file name.
|
||||||
#-renamesourcefileattribute SourceFile
|
#-renamesourcefileattribute SourceFile
|
||||||
|
|
||||||
|
-dontobfuscate
|
|
@ -1,7 +1,7 @@
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.3.41'
|
ext.kotlin_version = '1.3.50'
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue