Commit 273a73e6 authored by pengjunjign's avatar pengjunjign

remove:去除无用的代码

parent 86c96460
...@@ -6,13 +6,13 @@ plugins { ...@@ -6,13 +6,13 @@ plugins {
android { android {
signingConfigs { signingConfigs {
debug { debug {
storeFile file('\\app\\test_key.jks') storeFile file('\\test_key.jks')
storePassword 'test_key' storePassword 'test_key'
keyPassword 'test_key' keyPassword 'test_key'
keyAlias 'test_key' keyAlias 'test_key'
} }
config { config {
storeFile file('C:/Android/workspace/pushplatformdemo/app/test_key.jks') storeFile file('\\test_key.jks')
storePassword 'test_key' storePassword 'test_key'
keyPassword 'test_key' keyPassword 'test_key'
keyAlias 'test_key' keyAlias 'test_key'
......
...@@ -3,8 +3,9 @@ import java.text.SimpleDateFormat ...@@ -3,8 +3,9 @@ import java.text.SimpleDateFormat
// 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.5.0' ext.kotlin_version = '1.3.72'
repositories { repositories {
jcenter()
google() google()
mavenCentral() mavenCentral()
maven { url 'https://developer.huawei.com/repo/' } maven { url 'https://developer.huawei.com/repo/' }
...@@ -15,11 +16,14 @@ buildscript { ...@@ -15,11 +16,14 @@ buildscript {
classpath 'com.huawei.agconnect:agcp:1.3.1.300' classpath 'com.huawei.agconnect:agcp:1.3.1.300'
classpath 'com.huawei.agconnect:agcp:1.4.2.300' classpath 'com.huawei.agconnect:agcp:1.4.2.300'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.15.2"
} }
} }
allprojects { allprojects {
repositories { repositories {
jcenter()
google() google()
mavenCentral() mavenCentral()
maven { url 'https://developer.huawei.com/repo/' } maven { url 'https://developer.huawei.com/repo/' }
...@@ -30,63 +34,63 @@ task clean(type: Delete) { ...@@ -30,63 +34,63 @@ task clean(type: Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }
//推送模块目前使用的分支 ////推送模块目前使用的分支
String pushModuleCurrentBranch = "dev" //String pushModuleCurrentBranch = "dev"
//
/** ///**
* 导入推送模块, // * 导入推送模块,
* 如果push目录下为空(包含隐藏文件,.git文件), // * 如果push目录下为空(包含隐藏文件,.git文件),
* 则初始化子模块,拉取代码,切换到指定的分支 // * 则初始化子模块,拉取代码,切换到指定的分支
*/ // */
task importPushModule() { //task importPushModule() {
println("add submodule before") // println("add submodule before")
File pushModuleFile = new File(getProjectDir().toString() + File.separatorChar + "push") // File pushModuleFile = new File(getProjectDir().toString() + File.separatorChar + "push")
println("push module:" + pushModuleFile.toString()) // println("push module:" + pushModuleFile.toString())
//push目录下没有任何文件则视为没有初始化子模块 // //push目录下没有任何文件则视为没有初始化子模块
if (pushModuleFile.listFiles().length == 0) { // if (pushModuleFile.listFiles().length == 0) {
String cmd1 = "git submodule init".execute().text.trim() // String cmd1 = "git submodule init".execute().text.trim()
String cmd2 = "git submodule update".execute().text.trim() // String cmd2 = "git submodule update".execute().text.trim()
println(cmd1) // println(cmd1)
println(cmd2) // println(cmd2)
println("no init submodule , only init once in project") // println("no init submodule , only init once in project")
} // }
//切换所有子仓库的分支,有网络操作,会增加编译耗时,项目第一次完整构建完后视情况自行注释 // //切换所有子仓库的分支,有网络操作,会增加编译耗时,项目第一次完整构建完后视情况自行注释
("git submodule foreach git checkout " + pushModuleCurrentBranch).execute() // ("git submodule foreach git checkout " + pushModuleCurrentBranch).execute()
if (!isToday()) { // if (!isToday()) {
println("execute:git submodule foreach git pull") // println("execute:git submodule foreach git pull")
//拉取最新代码,有网络操作,会增加编译耗时,项目第一次完整构建完后视情况自行注释 // //拉取最新代码,有网络操作,会增加编译耗时,项目第一次完整构建完后视情况自行注释
"git submodule foreach git pull".execute() // "git submodule foreach git pull".execute()
} // }
println("git submodule foreach git branch".execute().text) // println("git submodule foreach git branch".execute().text)
println("add submodule after") // println("add submodule after")
//
} //}
//
/** ///**
* @return 今天是否更新过代码 // * @return 今天是否更新过代码
*/ // */
boolean isToday() { //boolean isToday() {
def result = false // def result = false
File file = new File(getProjectDir().toString() // File file = new File(getProjectDir().toString()
+ File.separatorChar + "app" // + File.separatorChar + "app"
+ File.separatorChar + "build" // + File.separatorChar + "build"
+ File.separatorChar + "lastPullSubmoduleDate.txt" // + File.separatorChar + "lastPullSubmoduleDate.txt"
) // )
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd") // SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd")
def today = dateFormat.format(new Date()) // def today = dateFormat.format(new Date())
if (file.exists()) { // if (file.exists()) {
def lines = file.readLines() // def lines = file.readLines()
if (lines.size() > 0) { // if (lines.size() > 0) {
result = (lines.get(0) == today) // result = (lines.get(0) == today)
} // }
} // }
//刷新日期内容 // //刷新日期内容
file.delete() // file.delete()
file.createNewFile() // file.createNewFile()
BufferedWriter fileWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, true), "UTF-8")); // BufferedWriter fileWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, true), "UTF-8"));
fileWriter.write(today) // fileWriter.write(today)
fileWriter.write("\n最后一次pull依赖仓库的时间,每日拉取一次") // fileWriter.write("\n最后一次pull依赖仓库的时间,每日拉取一次")
fileWriter.flush() // fileWriter.flush()
fileWriter.close() // fileWriter.close()
return result // return result
} //}
\ No newline at end of file \ No newline at end of file
android.useAndroidX=true
android.enableJetifier=true
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment