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/target/android/app/build.gradle

50 lines
1.4 KiB
Groovy
Raw Normal View History

2020-04-11 15:05:27 +08:00
import groovy.json.JsonSlurper
2019-12-05 20:52:38 +08:00
apply plugin: 'com.android.application'
2020-04-11 15:05:27 +08:00
def model = new JsonSlurper().parse(new File(project.rootDir.getParent() + File.separator + "package.json"))
def doricSDKVersion = model.dependencies.doric.replace("^", "")
println("Doric Version:" + doricSDKVersion)
2019-12-05 20:52:38 +08:00
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "pub.doric.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 {
2020-01-07 14:03:07 +08:00
assets.srcDirs = [project.getRootDir().getParent() + "/bundle"]
2019-12-05 20:52:38 +08:00
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
2020-04-11 15:05:27 +08:00
implementation "pub.doric:core:$doricSDKVersion"
debugImplementation "pub.doric:devkit:$doricSDKVersion"
2019-12-05 20:52:38 +08:00
}
2019-12-06 10:15:55 +08:00
}
afterEvaluate {
buildJSBundle.exec()
}
task buildJSBundle(type: Exec) {
2020-01-07 14:03:07 +08:00
workingDir project.rootDir.getParent()
2019-12-06 10:15:55 +08:00
commandLine 'doric', 'build'
2019-12-05 20:52:38 +08:00
}