Skip to content

Commit

Permalink
Merge pull request #28 from bytedance/yangzhiqian/master
Browse files Browse the repository at this point in the history
fix sample
  • Loading branch information
yangzhiqian authored May 6, 2020
2 parents f9a0b80 + 1a5ec0f commit 03a9563
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 9 deletions.
42 changes: 40 additions & 2 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ buildscript {
}
ext {
plugin_version = upload_version
enableMinify = true
}
dependencies {
classpath "com.bytedance.android.byteX:base-plugin:${plugin_version}"
Expand All @@ -35,6 +36,15 @@ android {
compileSdkVersion 28
buildToolsVersion "29.0.0"

signingConfigs {
release {
keyAlias 'bytex'
keyPassword 'bytex-example'
storeFile project.file("bytex.keystore")
storePassword 'bytex-example'
}
}

flavorDimensions "app", "mode"
productFlavors {
douyin {
Expand Down Expand Up @@ -62,15 +72,17 @@ android {

buildTypes {
release {
minifyEnabled true
minifyEnabled enableMinify
multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}

debug {
minifyEnabled true
minifyEnabled enableMinify
multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release

}
}
Expand All @@ -85,3 +97,29 @@ dependencies {
implementation "com.bytedance.android.byteX:coverage-lib:${plugin_version}"
}
apply from: project.file('plugin-bytex.gradle')

Set<String> assembles = new HashSet<>()
assembles.add("assembleDouyinCnDebug")
assembles.add("assembleDouyinCnRelease")
assembles.add("assembleDouyinI18nDebug")
assembles.add("assembleDouyinI18nRelease")
assembles.add("assembleBytexCnDebug")
assembles.add("assembleBytexCnRelease")
assembles.add("assembleBytexI18nDebug")
assembles.add("assembleBytexI18nRelease")
project.gradle
.startParameter
.taskRequests
.stream()
.flatMap() { it.args.stream() }
.filter { it.contains("assemble") }
.map { it.toLowerCase() }
.forEach {
if (!(
(it.contains("douyin") || it.contains("bytex")) &&
(it.contains("cn") || it.contains("i18n")) &&
(it.contains("release") || it.contains("debug"))
)) {
throw new IllegalArgumentException(assembles.join(",") + " supportted only")
}
}
Binary file added example/bytex.keystore
Binary file not shown.
14 changes: 8 additions & 6 deletions example/plugin-bytex.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ shrinkR {
}
}

apply plugin: 'bytex.getter_setter_inline'
getter_setter_inline {
enable pluginEnable
enableInDebug pluginEnableInDebug
logLevel pluginLogLevel
if (enableMinify) {
apply plugin: 'bytex.getter_setter_inline'
getter_setter_inline {
enable pluginEnable
enableInDebug pluginEnableInDebug
logLevel pluginLogLevel
}
}

apply plugin: 'bytex.closeable_checker'
Expand Down Expand Up @@ -252,7 +254,7 @@ field_assign_opt {
apply plugin: 'bytex.sourcefile'
SourceFile {
enable pluginEnable
enableInDebug pluginEnableInDebug
// enableInDebug pluginEnableInDebug
logLevel pluginLogLevel
deleteSourceFile true
deleteLineNumber true
Expand Down
2 changes: 1 addition & 1 deletion example/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:text="ByteX Sample!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
Expand Down

0 comments on commit 03a9563

Please sign in to comment.