From bac8336709b20c3d15b855a2932416d33e2e1117 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Wed, 10 Jan 2018 23:51:53 +0300 Subject: [PATCH] Make set-version script to update Eclipse plugin version --- .travis.yml | 13 +++++++----- set-version.sh | 16 +++++++++++++++ tools/eclipse/pom.xml | 9 +++++++++ update-cli.sh | 5 ----- update-idea-repository.sh => upload-files.sh | 21 ++++++++++++++++++++ 5 files changed, 54 insertions(+), 10 deletions(-) delete mode 100755 update-cli.sh rename update-idea-repository.sh => upload-files.sh (52%) diff --git a/.travis.yml b/.travis.yml index 0c3ef1149..5307d307c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,13 +22,17 @@ branches: before_install: - nvm install 7 - OLD_VERSION=`mvn help:evaluate -Dexpression=project.version 2>/dev/null | grep -Ev "(^\[|Download)"` - - NEW_VERSION=${OLD_VERSION%-SNAPSHOT}-dev-`printf %d $TRAVIS_BUILD_NUMBER` + - BASE_VERSION=${OLD_VERSION%-SNAPSHOT} + - NEW_VERSION=${BASE_VERSION}-dev-`printf %d $TRAVIS_BUILD_NUMBER` + - ECLIPSE_VERSION-${BASE_VERSION}.dev_`printf %d $TRAVIS_BUILD_NUMBER` - export NEW_VERSION + - export ECLIPSE_VERSION + - export BASE_VERSION - echo "Building version $NEW_VERSION" - - mvn versions:set -DnewVersion=$NEW_VERSION + - ./set-version.sh $NEW_VERSION $ECLIPSE_VERSION install: - - mvn install -Dteavm.build.all=false -P with-idea -DskipTests=true -Dmaven.javadoc.skip=true -B -V + - mvn install -Dteavm.build.all=false -P with-idea -P with-eclipse -DskipTests=true -Dmaven.javadoc.skip=true -B -V - pushd tests/src/test/js - npm config set prefix=$HOME/.node_modules - npm install @@ -56,8 +60,7 @@ after_success: > export TEAVM_FTP_LOGIN export TEAVM_FTP_PASSWORD mvn deploy -Dteavm.build.all=false -DskipTests --settings travis-settings.xml -P deploy-to-bintray -P with-idea && \ - ./update-idea-repository.sh - ./update-cli.sh + ./upload-files.sh fi after_script: - rm -rf $HOME/.m2/repository/org/teavm diff --git a/set-version.sh b/set-version.sh index 80d350027..c59764c23 100755 --- a/set-version.sh +++ b/set-version.sh @@ -1,3 +1,19 @@ #!/bin/sh mvn versions:set -DnewVersion=$1 -DgenerateBackupPoms=false + +pushd tools/eclipse +mvn tycho-versions:set-version -DnewVersion=$2 + +pushd core-plugin +sed -r -i -e "s/(.+)<\/version>/$1<\/version>/" dep-pom.xml +sed -r -i -e "s/(lib\/teavm(-[a-z]+)+)-.+\.jar/\1-$1.jar/" build.properties +sed -r -i -e "s/(lib\/teavm(-[a-z]+)+)-.+\.jar/\1-$1.jar/" META-INF/MANIFEST.MF +popd + +pushd m2e-plugin +sed -r -i -e "s/.+<\/versionRange>/$1<\/versionRange>/" lifecycle-mapping-metadata.xml +popd + +popd + diff --git a/tools/eclipse/pom.xml b/tools/eclipse/pom.xml index 72a07699c..0cecb0bcd 100644 --- a/tools/eclipse/pom.xml +++ b/tools/eclipse/pom.xml @@ -48,6 +48,15 @@ + + + + org.eclipse.tycho + tycho-versions-plugin + ${tycho.version} + + + org.eclipse.tycho diff --git a/update-cli.sh b/update-cli.sh deleted file mode 100755 index c5724ac5c..000000000 --- a/update-cli.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -curl --ftp-create-dirs -T tools/cli/target/teavm-cli-$NEW_VERSION.jar \ - -u $TEAVM_FTP_LOGIN:$TEAVM_FTP_PASSWORD \ - ftp://$TEAVM_FTP_HOST/httpdocs/cli/dev/teavm-cli-$NEW_VERSION.jar diff --git a/update-idea-repository.sh b/upload-files.sh similarity index 52% rename from update-idea-repository.sh rename to upload-files.sh index 248eef657..1ab577ecd 100755 --- a/update-idea-repository.sh +++ b/upload-files.sh @@ -1,5 +1,16 @@ #!/bin/bash +# +# Upload CLI +# +curl --ftp-create-dirs -T tools/cli/target/teavm-cli-$NEW_VERSION.jar \ + -u $TEAVM_FTP_LOGIN:$TEAVM_FTP_PASSWORD \ + ftp://$TEAVM_FTP_HOST/httpdocs/cli/dev/teavm-cli-$NEW_VERSION.jar + + +# +# Update IDEA repository descriptor +# cat <.idea-repository.xml @@ -13,3 +24,13 @@ EOF curl --ftp-create-dirs -T .idea-repository.xml \ -u $TEAVM_FTP_LOGIN:$TEAVM_FTP_PASSWORD \ ftp://$TEAVM_FTP_HOST/httpdocs/idea/dev/teavmRepository.xml + + +# +# Upload Eclipse plugin +# +pushd tools/eclipse/updatesite/target/repository + find . -type f -exec curl \ + --ftp-create-dirs \ + -u $TEAVM_FTP_LOGIN:$TEAVM_FTP_PASSWORD -T {} ftp://$TEAVM_FTP_HOST/httpdocs/eclipse/update-site/$BASE_VERSION-dev \; +popd \ No newline at end of file