Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host gradle automatically synchronizes the version number #194

Merged
merged 1 commit into from
Jul 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion replugin-host-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ buildscript {
}

group = 'com.qihoo360.replugin' // 组名
version = '2.1.3' // 版本
String classPath = ".src.main.groovy.com.qihoo360.replugin.gradle.host.AppConstant".replace(".", java.io.File.separator)
String verPath = "${project.projectDir}" + classPath + ".groovy"
String verLine = new File(verPath).filterLine { it =~ /def static final VER =/ }
version = "${verLine.split("\"")[1]}" // 版本
//红色醒目打印显示版本号
java.lang.System.err.println "version=${version}"

dependencies {
compile 'com.android.tools.build:gradle:2.1.3'
Expand Down Expand Up @@ -108,3 +113,4 @@ publishing {

apply from: 'bintray.gradle'


Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ package com.qihoo360.replugin.gradle.host
*/
class AppConstant {

/** 版本号 */
def static final VER = "2.1.4"

/** 打印信息时候的前缀 */
def static final TAG = "< replugin-host-v2.1.2 >"
def static final TAG = "< replugin-host-v${VER} >"

/** 外部用户配置信息 */
def static final USER_CONFIG = "repluginHostConfig"
Expand Down