Remove obsolete version override mechanism and increment-version.kts
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Icrements last segement of version string: 0.12.1223 -> 0.12.1224 and writes result to file.
|
||||
*/
|
||||
fun main(args: Array<String>) {
|
||||
val filePathDefault = "updated-version.txt"
|
||||
|
||||
if (args.isEmpty() || args.size > 2) {
|
||||
error("Usage: kotlinc -script increment-version.kts " +
|
||||
"<version> " +
|
||||
"<file-path='$filePathDefault'>")
|
||||
}
|
||||
|
||||
val versionStr = args[0]
|
||||
|
||||
val incrementPartStr = versionStr.takeLastWhile(Char::isDigit)
|
||||
val incrementPart = incrementPartStr.toInt()
|
||||
val versionPrefix = versionStr.take(versionStr.length - incrementPartStr.length)
|
||||
|
||||
val filePath = args.getOrNull(1) ?: filePathDefault
|
||||
|
||||
val result = "${versionPrefix}${incrementPart + 1}"
|
||||
|
||||
println("prefix=$versionPrefix incrementPart=$incrementPart result=$result filePath=$filePath")
|
||||
|
||||
File(filePath).writeText(result)
|
||||
}
|
||||
|
||||
main(args)
|
||||
@@ -22,17 +22,6 @@
|
||||
<property name="sdk.version.prefix" value="IU" if:set="use.ultimate.by.default"/>
|
||||
<property name="sdk.version.prefix" value="IC" unless:set="use.ultimate.by.default"/>
|
||||
|
||||
<!-- Uncomment to enable force version increment in branch. Set override.version.disabled to temporary disable feature without commits -->
|
||||
<!--
|
||||
<property name="override.version.branch" value="${kotlin.bootstrap.branch.locator}"/>
|
||||
<property name="override.version.url" value="https://teamcity.jetbrains.com/guestAuth/app/rest/builds/?locator=buildType:bt345,count:1,branch:${override.version.branch}"/>
|
||||
-->
|
||||
<!--<property name="override.version.disabled" value="true"/>-->
|
||||
|
||||
<condition property="kotlinc.executable.path" value="kotlinc.bat" else="kotlinc">
|
||||
<os family="windows"/>
|
||||
</condition>
|
||||
|
||||
<property name="kotlinx.coroutines.version" value="0.14.1"/>
|
||||
|
||||
<property name="generators" value="${basedir}/generators"/>
|
||||
@@ -187,8 +176,6 @@
|
||||
</target>
|
||||
|
||||
<target name="fetch-third-party" depends="get-ivy-library, make-dependency-dirs, make-native-platform-uberjar">
|
||||
<antcall target="override-version"/>
|
||||
|
||||
<!-- ProGuard -->
|
||||
<get-maven-library prefix="net/sf/proguard" lib="proguard-base" version="5.3" target.jar.name.base="proguard" src="false"/>
|
||||
<get-maven-library prefix="net/sf/proguard" lib="proguard-anttask" version="5.3" target.jar.name.base="proguard-anttask" src="false"/>
|
||||
@@ -835,48 +822,4 @@
|
||||
<arg path="${android.destination.dir}/bin/update_studio.sh"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="override-version">
|
||||
<condition property="need.version.override">
|
||||
<and>
|
||||
<isset property="override.version.url"/>
|
||||
<equals arg1="${override.version.branch}" arg2="${teamcity.build.branch}"/>
|
||||
<not>
|
||||
<isset property="override.version.disabled"/>
|
||||
</not>
|
||||
<not>
|
||||
<istrue value="${bootstrap.build.no.tests}"/>
|
||||
</not>
|
||||
<isset property="teamcity.version"/>
|
||||
</and>
|
||||
</condition>
|
||||
|
||||
<sequential if:set="need.version.override">
|
||||
<local name="override.version.build.number"/>
|
||||
<loadresource property="override.version.build.number">
|
||||
<url url="${override.version.url}"/>
|
||||
<filterchain>
|
||||
<tokenfilter>
|
||||
<filetokenizer/>
|
||||
<replaceregex pattern="^(.*)\snumber="([\w-+\.]+)"(.*)$" replace="\2" flags="s"/>
|
||||
</tokenfilter>
|
||||
</filterchain>
|
||||
</loadresource>
|
||||
|
||||
<echo message="URL: ${override.version.url} Version: ${override.version.build.number}"/>
|
||||
|
||||
<exec executable="${dependencies}/bootstrap-compiler/Kotlin/kotlinc/bin/${kotlinc.executable.path}" failonerror="false">
|
||||
<arg value="-cp"/>
|
||||
<arg value="${dependencies}/bootstrap-compiler/Kotlin/kotlinc/lib/kotlin-compiler.jar"/>
|
||||
<arg value="-script"/>
|
||||
<arg value="${generators}/infrastructure/increment-version.kts"/>
|
||||
<arg value="${override.version.build.number}"/>
|
||||
<arg value="${dependencies}/updated-version.txt"/>
|
||||
</exec>
|
||||
|
||||
<loadfile property="updated.version.number" srcFile="${dependencies}/updated-version.txt"/>
|
||||
|
||||
<echo message="##teamcity[buildNumber '${updated.version.number}']"/>
|
||||
</sequential>
|
||||
</target>
|
||||
</project>
|
||||
|
||||
Reference in New Issue
Block a user