This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-cli/assets-lib/example/android/app/build.gradle
2022-07-13 16:39:08 +08:00

48 lines
1.4 KiB
Groovy

import groovy.json.JsonSlurper
def model = new JsonSlurper().parse(new File(project.rootDir.parentFile.parent + File.separator + "package.json"))
def doricSDKVersion = model.peerDependencies.doric.replace("^", "").replace(">=","")
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "pub.doric.android.example"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
assets.srcDirs = [project.getRootDir().getParent() + "/bundle"]
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation project(":lib")
implementation "pub.doric:devkit:$doricSDKVersion"
}
}
afterEvaluate {
buildJSBundle.exec()
}
task buildJSBundle(type: Exec) {
workingDir project.rootDir.getParent()
commandLine 'npm', 'run', 'build'
}