Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
LinXueyuanStdio committed Sep 4, 2021
1 parent 715c7ce commit a139bf3
Show file tree
Hide file tree
Showing 17 changed files with 107 additions and 202 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

48 changes: 17 additions & 31 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,55 +1,41 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
def moduleConfigProps = new Properties()
File moduleConfig = rootProject.file("moduleConfig.properties")
if (moduleConfig.exists()) {
moduleConfigProps.load(new FileInputStream(moduleConfig))
}
def localMavenDir = file(moduleConfigProps.localMavenPath)

ext.kotlin_version = '1.4.31'

ext.shadow_version = '2.0.15'
apply from: "${gradle.ext.localGradleDir}/settings/deps.gradle"

repositories {
maven { url "file://${localMavenDir.absolutePath}" }
maven { url "file://${gradle.ext.localMavenDir.absolutePath}" }
google()
mavenCentral()
maven { url "https://jitpack.io" }

maven { url "https://plugins.gradle.org/m2/" }
google()
jcenter()
maven { url "https://repo1.maven.org/maven2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:7.0.0'
classpath classpath.kotlin
classpath classpath.component_router
classpath classpath.bugly
classpath classpath.analysis
classpath classpath.upload
}
}

def moduleConfigProps = new Properties()
File moduleConfig = rootProject.file("moduleConfig.properties")
if (moduleConfig.exists()) {
moduleConfigProps.load(new FileInputStream(moduleConfig))
}
def localMavenDir = file(moduleConfigProps.localMavenPath)
def localGradleDir = file(moduleConfigProps.localGradlePath)

allprojects {

repositories {
maven { url "file://${localMavenDir.absolutePath}" }
maven { url "file://${gradle.ext.localMavenDir.absolutePath}" }

google()
jcenter()
mavenLocal()
mavenCentral()
maven { url "https://jitpack.io" }

maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://repo1.maven.org/maven2/" }

maven { url "https://oss.sonatype.org/content/repositories/snapshots" } // for org-java
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

apply from: "${localGradleDir}/deps.gradle"
38 changes: 38 additions & 0 deletions context.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
def loadProperties(filename) {
Properties properties = new Properties()

def file = new File(settingsDir, filename)

if (file.exists()) {
properties.load(file.newDataInputStream())
} else {
logger.warn("Properties file ${file} does not exist")
}

return properties
}

gradle.ext.appProperties = loadProperties('app.properties')
gradle.ext.moduleConfig = loadProperties('moduleConfig.properties')
gradle.ext.localMavenDir = file(gradle.ext.moduleConfig.localMavenPath)
gradle.ext.localGradleDir = file(gradle.ext.moduleConfig.localGradlePath)


// 引入composing的设置
apply from: "gradle/composingConfig.gradle"
// 遍历composing_dependencies中的所有配置
ext.getProperty("composing_dependencies").each { projectConfig ->
def isLocal = projectConfig["isLocal"]
def projectPath = projectConfig["projectPath"]
def projectMaven = projectConfig["projectMaven"]
def projectName = projectConfig["projectName"]
// 如果是本地依赖
if (isLocal) {
// 使用本地依赖进行替换
includeBuild(projectPath) {
dependencySubstitution {
substitute module(projectMaven) with project(projectName)
}
}
}
}
36 changes: 0 additions & 36 deletions gradle/library/publish_to_local_maven.gradle

This file was deleted.

69 changes: 1 addition & 68 deletions gradle/library_header.gradle
Original file line number Diff line number Diff line change
@@ -1,68 +1 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 29

defaultConfig {
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']

javaCompileOptions {
annotationProcessorOptions {
arguments = [
"moduleName" : project.getName(),
"HOST" : project.getName().replace("-", ""),
"RouterDocFolder": "${project.rootDir}/RouterDocument".toString(),
"RouterDocEnable": String.valueOf("true")
]
}
}
}

buildTypes {
debug {
buildConfigField "boolean", "LOG_DEBUG", "true"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', file(rootProject.ext.android["globalProguardFilesPath"])
}

release {
buildConfigField "boolean", "LOG_DEBUG", "false"
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', file(rootProject.ext.android["globalProguardFilesPath"])
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
disable 'MissingTranslation'
disable 'ExtraTranslation'
disable 'BlockedPrivateApi'
}

dexOptions {
jumboMode = true
}

useLibrary 'org.apache.http.legacy'
}


dependencies {
kapt rootProject.ext.dependencies["dagger2-compiler"]
kapt rootProject.ext.dependencies["router-compiler"]

api rootProject.ext.dependencies["kotlin-stdlib"]
}
apply from: "${gradle.ext.localGradleDir}/library/header.gradle"
17 changes: 1 addition & 16 deletions gradle/library_tail.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
def moduleConfigProps = new Properties()
File moduleConfig = rootProject.file("moduleConfig.properties")
if (moduleConfig.exists()) {
moduleConfigProps.load(new FileInputStream(moduleConfig))
}

def localMavenDir = new File(rootDir, moduleConfigProps.localMavenPath)
def localGradleDir = new File(rootDir, moduleConfigProps.localGradlePath)
def localLibraryGradleDir = new File(localGradleDir, "library")
if (localLibraryGradleDir.exists()) {
FilenameFilter filter = { dir, filename -> filename.endsWith(".gradle") }
def gradleFiles = localLibraryGradleDir.listFiles filter
gradleFiles.each { file ->
apply from: "file://${file.absolutePath}"
}
}
apply from: "${gradle.ext.localGradleDir}/library/footer.gradle"
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jun 25 20:58:55 CST 2021
#Sat Mar 13 10:38:09 CST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
4 changes: 2 additions & 2 deletions moduleConfig.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 本地 maven 的路径
localMavenPath=/Users/zby/Documents/GitHub/mempool/TimeCatMaven
localMavenPath=/Users/zby/Documents/timecat/mempool/TimeCatMaven
# 本地 gradle 的路径
localGradlePath=/Users/zby/Documents/GitHub/mempool/TimeCatGradle
localGradlePath=/Users/zby/Documents/timecat/mempool/TimeCatGradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void onClick(View v) {
});
}

private void bindEt(final EditText editText, final GithubSetting setting) {
private void bindEt(EditText editText, GithubSetting setting) {
String text = DEF.githubApp().getString(setting.key, setting.defaultValue);
editText.setText(text);
editText.addTextChangedListener(new TextWatcher() {
Expand Down
41 changes: 11 additions & 30 deletions plugin-normal-apk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,40 +1,21 @@
apply plugin: 'com.android.application'
apply from: "${gradle.ext.localGradleDir}/project/plugin_header.gradle"

android {
compileSdkVersion 29
defaultConfig {
applicationId "com.tencent.shadow.sample.plugin"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

signingConfig signingConfigs.create("release")
signingConfig.initWith(buildTypes.debug.signingConfig)
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/rxjava.properties'
}
}

dependencies {
api project(':plugin-main-lib')
// implementation 'androidx.appcompat:appcompat:1.0.2'
// implementation 'com.tencent:mmkv:1.0.16'
//
// def retrofitSdkVersion = "2.6.0"
// implementation "com.squareup.retrofit2:retrofit:$retrofitSdkVersion"
// implementation "com.squareup.retrofit2:converter-gson:$retrofitSdkVersion"
// implementation "com.squareup.retrofit2:adapter-rxjava:$retrofitSdkVersion"
// implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitSdkVersion"
// implementation "com.squareup.okhttp3:okhttp:3.10.0"
// implementation "io.reactivex.rxjava2:rxandroid:2.0.1"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.tencent:mmkv:1.0.16'

def retrofitSdkVersion = "2.6.0"
implementation "com.squareup.retrofit2:retrofit:$retrofitSdkVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitSdkVersion"
implementation "com.squareup.retrofit2:adapter-rxjava:$retrofitSdkVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitSdkVersion"
implementation "com.squareup.okhttp3:okhttp:3.10.0"
implementation "io.reactivex.rxjava2:rxandroid:2.0.1"
}
3 changes: 1 addition & 2 deletions plugin-shadow-apk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//先照抄一下plugin-normal-apk
apply from: '../plugin-normal-apk/build.gradle'
apply from: "${gradle.ext.localGradleDir}/project/plugin_header.gradle"

android {
defaultConfig {
Expand Down
6 changes: 6 additions & 0 deletions sample-loader/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ android {
signingConfig.initWith(buildTypes.debug.signingConfig)
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}

dependencies {
Expand Down
Loading

0 comments on commit a139bf3

Please sign in to comment.