Make set-version script to update Eclipse plugin version

This commit is contained in:
Alexey Andreev 2018-01-10 23:51:53 +03:00
parent 02f61b5d50
commit bac8336709
5 changed files with 54 additions and 10 deletions

View File

@ -22,13 +22,17 @@ branches:
before_install: before_install:
- nvm install 7 - nvm install 7
- OLD_VERSION=`mvn help:evaluate -Dexpression=project.version 2>/dev/null | grep -Ev "(^\[|Download)"` - 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 NEW_VERSION
- export ECLIPSE_VERSION
- export BASE_VERSION
- echo "Building version $NEW_VERSION" - echo "Building version $NEW_VERSION"
- mvn versions:set -DnewVersion=$NEW_VERSION - ./set-version.sh $NEW_VERSION $ECLIPSE_VERSION
install: 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 - pushd tests/src/test/js
- npm config set prefix=$HOME/.node_modules - npm config set prefix=$HOME/.node_modules
- npm install - npm install
@ -56,8 +60,7 @@ after_success: >
export TEAVM_FTP_LOGIN export TEAVM_FTP_LOGIN
export TEAVM_FTP_PASSWORD export TEAVM_FTP_PASSWORD
mvn deploy -Dteavm.build.all=false -DskipTests --settings travis-settings.xml -P deploy-to-bintray -P with-idea && \ mvn deploy -Dteavm.build.all=false -DskipTests --settings travis-settings.xml -P deploy-to-bintray -P with-idea && \
./update-idea-repository.sh ./upload-files.sh
./update-cli.sh
fi fi
after_script: after_script:
- rm -rf $HOME/.m2/repository/org/teavm - rm -rf $HOME/.m2/repository/org/teavm

View File

@ -1,3 +1,19 @@
#!/bin/sh #!/bin/sh
mvn versions:set -DnewVersion=$1 -DgenerateBackupPoms=false 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><!-- update -->(.+)<\/version>/<version><!-- update -->$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>.+<\/versionRange>/<versionRange>$1<\/versionRange>/" lifecycle-mapping-metadata.xml
popd
popd

View File

@ -48,6 +48,15 @@
</repositories> </repositories>
<build> <build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-versions-plugin</artifactId>
<version>${tycho.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.eclipse.tycho</groupId> <groupId>org.eclipse.tycho</groupId>

View File

@ -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

View File

@ -1,5 +1,16 @@
#!/bin/bash #!/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 <<EOF >.idea-repository.xml cat <<EOF >.idea-repository.xml
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<plugins> <plugins>
@ -13,3 +24,13 @@ EOF
curl --ftp-create-dirs -T .idea-repository.xml \ curl --ftp-create-dirs -T .idea-repository.xml \
-u $TEAVM_FTP_LOGIN:$TEAVM_FTP_PASSWORD \ -u $TEAVM_FTP_LOGIN:$TEAVM_FTP_PASSWORD \
ftp://$TEAVM_FTP_HOST/httpdocs/idea/dev/teavmRepository.xml 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