Skip to content
Snippets Groups Projects
Commit 72b97bed authored by anttil's avatar anttil
Browse files

SWE-22 / SP-641: branching / tagging of project 'base'

SVN: 29104
parent bb82adac
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -12,7 +12,7 @@ svn checkout --depth=empty svn+ssh://svncisd.ethz.ch/repos/cisd/base/branches/$1 ...@@ -12,7 +12,7 @@ svn checkout --depth=empty svn+ssh://svncisd.ethz.ch/repos/cisd/base/branches/$1
cd out/temp_checkout cd out/temp_checkout
svn update gradlew gradle build.gradle svn update gradlew gradle build.gradle
./gradlew dependencyReport ./gradlew dependencyReport
cat out/reports/project/dependencies.txt|egrep ^.---|awk '{print $2}'|sort|uniq|egrep -v ^$|awk -F: '{print "s/" $1 ":" $2 ":+/" $1 ":" $2 ":" $3 "/g"}' > sed_commands cat out/reports/project/dependencies.txt|egrep ^.---|grep \>|sort|uniq|awk '{print $2 ":" $4}'|awk -F: '{print "s/" $1 ":" $2 ":" $3 "/" $1 ":" $2 ":" $4 "/g"}' > sed_commands
sed -f sed_commands build.gradle > build.gradle.tmp sed -f sed_commands build.gradle > build.gradle.tmp
mv build.gradle.tmp build.gradle mv build.gradle.tmp build.gradle
svn commit build.gradle -m "fixed dependencies for branch $1" svn commit build.gradle -m "fixed dependencies for branch $1"
......
...@@ -12,22 +12,26 @@ dependencies { ...@@ -12,22 +12,26 @@ dependencies {
group="cisd" group="cisd"
version="UNSPECIFIED_VERSION" new ByteArrayOutputStream().withStream { os ->
def result = exec {
if (version.equals("UNSPECIFIED_VERSION")) { executable = 'svn'
new ByteArrayOutputStream().withStream { os -> args = ['info']
def result = exec { standardOutput = os
executable = 'svn' }
args = ['info'] def outputAsString = os.toString()
standardOutput = os def matchLastChangedRevMatcher = outputAsString =~ /Last Changed Rev: (\d+)/
} def urlMatcher = outputAsString =~ /URL: .*\/(.+)/
def outputAsString = os.toString()
def matchLastChangedRev = outputAsString =~ /Last Changed Rev: (\d+)/ def revision = "r${matchLastChangedRevMatcher[0][1]}"
project.version = "r${matchLastChangedRev[0][1]}" def branch = urlMatcher[0][1]
if (branch.equals('trunk')) {
project.version = revision
} else {
project.version = branch
} }
} }
publishing { publishing {
publications { publications {
ivy(IvyPublication) { ivy(IvyPublication) {
......
...@@ -5,13 +5,5 @@ if [ $? -ne 0 ]; then echo "Branch does not exist!"; exit 1; fi ...@@ -5,13 +5,5 @@ if [ $? -ne 0 ]; then echo "Branch does not exist!"; exit 1; fi
svn info svn+ssh://svncisd.ethz.ch/repos/cisd/base/tags/$1/$2 2>/dev/null svn info svn+ssh://svncisd.ethz.ch/repos/cisd/base/tags/$1/$2 2>/dev/null
if [ $? -eq 0 ]; then echo "Tag already exists!"; exit 1; fi if [ $? -eq 0 ]; then echo "Tag already exists!"; exit 1; fi
svn mkdir --parents svn+ssh://svncisd.ethz.ch/repos/cisd/base/tags/$1 -m "create tag folders $1/$2"
svn copy svn+ssh://svncisd.ethz.ch/repos/cisd/base/branches/$1 svn+ssh://svncisd.ethz.ch/repos/cisd/base/tags/$1/$2 -m "create tag $1/$2" svn copy svn+ssh://svncisd.ethz.ch/repos/cisd/base/branches/$1 svn+ssh://svncisd.ethz.ch/repos/cisd/base/tags/$1/$2 -m "create tag $1/$2"
mkdir -p out
rm -r out/temp_checkout
svn checkout --depth=empty svn+ssh://svncisd.ethz.ch/repos/cisd/base/tags/$1/$2 out/temp_checkout
cd out/temp_checkout
svn update build.gradle
sed -e "s/version=\"UNSPECIFIED_VERSION\"/version=\"$2\"/" build.gradle > build.gradle.tmp
mv build.gradle.tmp build.gradle
#svn commit build.gradle -m "fixed version for tag $1/$2"
cd ../..
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment