Commit 273a73e6 authored by pengjunjign's avatar pengjunjign

remove:去除无用的代码

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