Move utility scripts to util dir, add secure vars to CI username/pwd, update POM to use canonical snapshot dir, add support for snapshot on succesful commit in Travis.
diff --git a/.travis.yml b/.travis.yml
index d9dfb24..b3f31dd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,6 +9,8 @@
env:
global:
- secure: "WuvBM11o29dIluXelJpV1TFPqprFOlLEs6ES4LjvNKrtB/FT9g569Q63jnbg43ufs4fhQZKuqc3ue1KwZiWWozmkRTry8+2KimiCC0QRFc2UfWPy5BBlPepWahnkC5/CSnjQWtTVKzs67DobyCmAsU3mraOidQatXSpoOozGnNA="
+ - secure: "pAeI941ODNSo6F7A94WFafxYqp2kdeFTJksMLVHljT0h2nX6/236OXn/iZXiB+FbXe/DkQIHN3n1IZRwE8UJAbSAwoaPUWenPy4mNAhnI4L/rwysREwq5FKSFTWJet9HitfFR57ezLGOV0VLFfH1xGsNWabHzzbwbV3WMl9pH0M="
+ - secure: "Pqj194YmdK0va4bOkbjVG0wCZ7sbB5k3Qq66zSG2M26M21uHonwhXprdtSeYZ5Oy9fWcQte7jSA69euyYyLriDH6DU2NE34scK2Y1yO6SCfx5SGr3XuxHWqxtNOxoUaH4RP1WR/9CRkBg8kBxzWus3M2ZeqElu33/p2CtgJEdJg="
matrix:
- LABEL=ant CMD="ant dist test.dist" INSTALL="/bin/true"
- LABEL=ant_no_aop CMD="ant -f build/no_aop/build.xml dist test.dist" INSTALL="ant no_aop"
@@ -26,7 +28,8 @@
- google-guice-dev+ci@googlegroups.com
after_success:
- - ./generate-latest-docs.sh
+ - util/generate-latest-docs.sh
+ - util/publish-snapshot-on-commit.sh
branches:
only:
diff --git a/pom.xml b/pom.xml
index 58ebbb1..37305d0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,6 +84,14 @@
</license>
</licenses>
+ <distributionManagement>
+ <!-- override the parent's directory to point to the canonical place, and use https. -->
+ <snapshotRepository>
+ <id>google-snapshots</id>
+ <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+ </snapshotRepository>
+ </distributionManagement>
+
<modules>
<module>core</module>
<module>extensions</module>
diff --git a/compareBuilds.sh b/util/compareBuilds.sh
similarity index 100%
rename from compareBuilds.sh
rename to util/compareBuilds.sh
diff --git a/generate-latest-docs.sh b/util/generate-latest-docs.sh
similarity index 100%
rename from generate-latest-docs.sh
rename to util/generate-latest-docs.sh
diff --git a/util/publish-snapshot-on-commit.sh b/util/publish-snapshot-on-commit.sh
new file mode 100755
index 0000000..19b571b
--- /dev/null
+++ b/util/publish-snapshot-on-commit.sh
@@ -0,0 +1,17 @@
+# see https://coderwall.com/p/9b_lfq
+
+if [ "$TRAVIS_REPO_SLUG" == "google/guice" ] && \
+ [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && \
+ [ "$LABEL" == "mvn" ] && \
+ [ "$TRAVIS_PULL_REQUEST" == "false" ] && \
+ [ "$TRAVIS_BRANCH" == "master" ]; then
+ echo -e "Publishing maven snapshot...\n"
+
+ cd $HOME
+ git clone --quiet --branch=travis https://github.com/google/guice travis > /dev/null
+ cd -
+
+ mvn clean deploy --settings="$HOME/travis/settings.xml" -DskipTests=true -Dmaven.javadoc.skip=true
+
+ echo -e "Published maven snapshot"
+fi