|
|
|
@ -1,145 +1 @@ |
|
|
|
|
include ':app' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def properties = properties(rootProject) |
|
|
|
|
def bcDir = properties.getProperty('bingce.dir') |
|
|
|
|
|
|
|
|
|
if (bcDir == null || bcDir.empty) throw new RuntimeException("需要在local.properties中设置bingce.dir路径") |
|
|
|
|
|
|
|
|
|
// 定义一个方法来获取指定目录下的当前 Git 分支 |
|
|
|
|
def listGitBranches(File gitDirectory) { |
|
|
|
|
def command = ['git', 'symbolic-ref', '--short', '-q', 'HEAD'] |
|
|
|
|
def processBuilder = new ProcessBuilder(command) |
|
|
|
|
|
|
|
|
|
// 设置工作目录为指定的 Git 仓库目录 |
|
|
|
|
processBuilder.directory(gitDirectory) |
|
|
|
|
|
|
|
|
|
// 捕获命令输出 |
|
|
|
|
def process = processBuilder.start() |
|
|
|
|
def reader = new BufferedReader(new InputStreamReader(process.inputStream)) |
|
|
|
|
def branches = [] |
|
|
|
|
String line |
|
|
|
|
while ((line = reader.readLine()) != null) { |
|
|
|
|
return line |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 检查进程是否成功执行 |
|
|
|
|
def exitCode = process.waitFor() |
|
|
|
|
if (exitCode != 0) { |
|
|
|
|
// 如果命令执行失败,可以抛出异常或做其他处理 |
|
|
|
|
throw new RuntimeException("Git command failed with exit code ${exitCode}") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return "" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 例如,要检测指定目录的 Git 分支,可以调用 getGitBranch 方法 |
|
|
|
|
//def gitDirectory = new File(bcDir) |
|
|
|
|
//def currentBranch = listGitBranches(gitDirectory) |
|
|
|
|
// |
|
|
|
|
//if (currentBranch != "master_alpha_tj_offline") throw new RuntimeException("需要将${bcDir}仓库切换到master_alpha_tj_offline分支") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static def properties(ProjectDescriptor rootProject) { |
|
|
|
|
Properties properties = new Properties() |
|
|
|
|
properties.load(new File(rootProject.projectDir, 'local.properties').newDataInputStream()) |
|
|
|
|
return properties |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static def bingceModule(ProjectDescriptor rootProject, String name) { |
|
|
|
|
def properties = properties(rootProject) |
|
|
|
|
def useAAR = properties.getProperty('useAAR') |
|
|
|
|
def useBaseAAR = properties.getProperty('useBaseAAR') |
|
|
|
|
|
|
|
|
|
if ("base" == name) { |
|
|
|
|
if ("false" == useBaseAAR && "false" == useAAR) { |
|
|
|
|
return ":bingce:base" |
|
|
|
|
} else { |
|
|
|
|
return ":aar:base" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if ("false" == useAAR) { |
|
|
|
|
return ":bingce:$name" |
|
|
|
|
} else { |
|
|
|
|
return ":aar:$name" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static def openSourceModule(ProjectDescriptor rootProject, String name) { |
|
|
|
|
def properties = properties(rootProject) |
|
|
|
|
def useAAR = properties.getProperty('useAAR') |
|
|
|
|
|
|
|
|
|
if ("false" == useAAR) { |
|
|
|
|
return ":opensource:$name" |
|
|
|
|
} else { |
|
|
|
|
return ":aar:$name" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static def includeBingceModule(Settings settings, ProjectDescriptor rootProject, String bcDir, String name) { |
|
|
|
|
def moduleName = bingceModule(rootProject, name) |
|
|
|
|
settings.include(moduleName) |
|
|
|
|
if (moduleName == ":aar:base") return // base 模块不需要设置 projectDir |
|
|
|
|
settings.project(moduleName).projectDir = new File(bcDir, "bingce/$name") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static def includeOpenSourceModule(Settings settings, ProjectDescriptor rootProject, String bcDir, String name) { |
|
|
|
|
settings.include(openSourceModule(rootProject, name)) |
|
|
|
|
settings.project(openSourceModule(rootProject, name)).projectDir = new File(bcDir, "opensource/$name") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static def includeSdkModule(Settings settings, ProjectDescriptor rootProject, String bcDir, String name) { |
|
|
|
|
def moduleName = ":sdk:$name" |
|
|
|
|
settings.include(moduleName) |
|
|
|
|
settings.project(moduleName).projectDir = new File(bcDir, "sdk/$name") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
includeBingceModule(settings, rootProject, bcDir, "base") |
|
|
|
|
includeBingceModule(settings, rootProject, bcDir, "base-java") |
|
|
|
|
includeBingceModule(settings, rootProject, bcDir, "appBase") |
|
|
|
|
includeBingceModule(settings, rootProject, bcDir, "leancloud") |
|
|
|
|
includeBingceModule(settings, rootProject, bcDir, "repository") |
|
|
|
|
includeBingceModule(settings, rootProject, bcDir, "coordlib") |
|
|
|
|
includeBingceModule(settings, rootProject, bcDir, "device") |
|
|
|
|
includeBingceModule(settings, rootProject, bcDir, "device-ui") |
|
|
|
|
includeBingceModule(settings, rootProject, bcDir, "utils") |
|
|
|
|
includeBingceModule(settings, rootProject, bcDir, "totalstation") |
|
|
|
|
includeBingceModule(settings, rootProject, bcDir, "rtk") |
|
|
|
|
includeBingceModule(settings, rootProject, bcDir, "level") |
|
|
|
|
includeBingceModule(settings, rootProject, bcDir, "bc-dialog") |
|
|
|
|
includeBingceModule(settings, rootProject, bcDir, "DialogXInterface") |
|
|
|
|
includeBingceModule(settings, rootProject, bcDir, "bcdialog-style") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "hellocharts") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "gson") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "fastjson") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "javadxf") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "utilcode") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "colorful") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "dragExpandGrid") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "lsettingitemlibrary") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "spinkit") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "splashview") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "poishadowjar") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "safFilePicker") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "exFilePicker") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "agentweb") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "fastBle") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "socket-core") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "socket-common-interface") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "socket-client") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "socket-usbSerialForAndroid") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "usbSerialForAndroid") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "menuItemBadge") |
|
|
|
|
includeOpenSourceModule(settings, rootProject, bcDir, "triangle-library") |
|
|
|
|
|
|
|
|
|
includeSdkModule(settings, rootProject, bcDir, "jama") |
|
|
|
|
includeSdkModule(settings, rootProject, bcDir, "libqxwz-sdkcore") |
|
|
|
|
includeSdkModule(settings, rootProject, bcDir, "libsixents-sdkcore") |
|
|
|
|
includeSdkModule(settings, rootProject, bcDir, "cmccSdk") |
|
|
|
|
includeSdkModule(settings, rootProject, bcDir, "luowangSdk") |
|
|
|
|
includeSdkModule(settings, rootProject, bcDir, "ruide-extension-sdk") |
|
|
|
|
includeSdkModule(settings, rootProject, bcDir, "huaceRtkSdk") |
|
|
|
|
includeSdkModule(settings, rootProject, bcDir, "southGnssSdk") |
|
|
|
|
includeSdkModule(settings, rootProject, bcDir, "tensorFlowTTS") |
|
|
|
|