From 5dc88d7c1d9d1a9d49f256233c2acc2cb48a7520 Mon Sep 17 00:00:00 2001 From: Ajay Kannan Date: Tue, 1 Sep 2015 15:29:19 -0700 Subject: [PATCH] new script to update version in pom.xml and README docs. Also updates outdated links in the modules' README files --- README.md | 6 +++--- gcloud-java-core/README.md | 4 ++-- gcloud-java-datastore/README.md | 6 +++--- gcloud-java-examples/README.md | 4 ++-- gcloud-java-storage/README.md | 4 ++-- gcloud-java/README.md | 8 ++++---- utilities/update_version.sh | 36 +++++++++++++++++++++++++++++++++ 7 files changed, 52 insertions(+), 16 deletions(-) create mode 100644 utilities/update_version.sh diff --git a/README.md b/README.md index 82d133495559..9c9d2c0b530c 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ Java idiomatic client for [Google Cloud Platform][cloud-platform] services. [![Maven](https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java.svg)]( https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java.svg) - [Homepage] (https://googlecloudplatform.github.io/gcloud-java/) -- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs) -- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/examples/package-summary.html) +- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs) +- [Examples] (http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs/index.html?com/google/gcloud/examples/package-summary.html) This client supports the following Google Cloud Platform services: @@ -122,7 +122,7 @@ Apache 2.0 - See [LICENSE] for more information. [cloud-datastore]: https://cloud.google.com/datastore/docs [cloud-datastore-docs]: https://cloud.google.com/datastore/docs [cloud-datastore-activation]: https://cloud.google.com/datastore/docs/activate -[datastore-api]: http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/datastore/package-summary.html +[datastore-api]: http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs/index.html?com/google/gcloud/datastore/package-summary.html [cloud-pubsub]: https://cloud.google.com/pubsub/ [cloud-pubsub-docs]: https://cloud.google.com/pubsub/docs diff --git a/gcloud-java-core/README.md b/gcloud-java-core/README.md index 42cb3e368a61..f8ab8a4eef72 100644 --- a/gcloud-java-core/README.md +++ b/gcloud-java-core/README.md @@ -7,8 +7,8 @@ Java idiomatic client for [Google Cloud Platform][cloud-platform] services. [![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/gcloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/gcloud-java?branch=master) - [Homepage] (https://googlecloudplatform.github.io/gcloud-java/) -- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs) -- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/examples/package-summary.html) +- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs/) +- [Examples] (http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs/index.html?com/google/gcloud/examples/package-summary.html) This module provides common functionality and is required by the other service specific modules. diff --git a/gcloud-java-datastore/README.md b/gcloud-java-datastore/README.md index 3ea30c871124..645f1370c4cd 100644 --- a/gcloud-java-datastore/README.md +++ b/gcloud-java-datastore/README.md @@ -7,8 +7,8 @@ Java idiomatic client for [Google Cloud Platform][cloud-platform] services. [![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/gcloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/gcloud-java?branch=master) - [Homepage] (https://googlecloudplatform.github.io/gcloud-java/) -- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs) -- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/examples/package-summary.html) +- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs) +- [Examples] (http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs/index.html?com/google/gcloud/examples/package-summary.html) This client supports [Google Cloud Datastore] (https://cloud.google.com/datastore/) @@ -102,5 +102,5 @@ Apache 2.0 - See [LICENSE] for more information. [cloud-datastore]: https://cloud.google.com/datastore/docs [cloud-datastore-docs]: https://cloud.google.com/datastore/docs [cloud-datastore-activation]: https://cloud.google.com/datastore/docs/activate -[datastore-api]: http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/datastore/package-summary.html +[datastore-api]: http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs/index.html?com/google/gcloud/datastore/package-summary.html diff --git a/gcloud-java-examples/README.md b/gcloud-java-examples/README.md index e34136d079f0..87da175d129b 100644 --- a/gcloud-java-examples/README.md +++ b/gcloud-java-examples/README.md @@ -7,8 +7,8 @@ Examples for gcloud-java (Java idiomatic client for [Google Cloud Platform][clou [![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/gcloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/gcloud-java?branch=master) - [Homepage] (https://googlecloudplatform.github.io/gcloud-java/) -- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs) -- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/examples/package-summary.html) +- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs) +- [Examples] (http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs/index.html?com/google/gcloud/examples/package-summary.html) Quickstart diff --git a/gcloud-java-storage/README.md b/gcloud-java-storage/README.md index c1ee260a076e..2631bf41856e 100644 --- a/gcloud-java-storage/README.md +++ b/gcloud-java-storage/README.md @@ -7,8 +7,8 @@ Java idiomatic client for [Google Cloud Platform][cloud-platform] services. [![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/gcloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/gcloud-java?branch=master) - [Homepage] (https://googlecloudplatform.github.io/gcloud-java/) -- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs) -- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/examples/package-summary.html) +- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs) +- [Examples] (http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs/index.html?com/google/gcloud/examples/package-summary.html) This client supports the [Google Cloud Storage] (https://cloud.google.com/storage/) diff --git a/gcloud-java/README.md b/gcloud-java/README.md index c9fdc849fc6d..4b14a78005f0 100644 --- a/gcloud-java/README.md +++ b/gcloud-java/README.md @@ -7,8 +7,8 @@ Java idiomatic client for [Google Cloud Platform][cloud-platform] services. [![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/gcloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/gcloud-java?branch=master) - [Homepage] (https://googlecloudplatform.github.io/gcloud-java/) -- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs) -- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/examples/package-summary.html) +- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs) +- [Examples] (http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs/index.html?com/google/gcloud/examples/package-summary.html) This client supports the following Google Cloud Platform services: @@ -62,7 +62,7 @@ Apache 2.0 - See [LICENSE] for more information. [cloud-datastore]: https://cloud.google.com/datastore/docs [cloud-datastore-docs]: https://cloud.google.com/datastore/docs [cloud-datastore-activation]: https://cloud.google.com/datastore/docs/activate -[datastore-api]: http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/datastore/package-summary.html +[datastore-api]: http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs/index.html?com/google/gcloud/datastore/package-summary.html [cloud-pubsub]: https://cloud.google.com/pubsub/ [cloud-pubsub-docs]: https://cloud.google.com/pubsub/docs @@ -70,4 +70,4 @@ Apache 2.0 - See [LICENSE] for more information. [cloud-storage]: https://cloud.google.com/storage/ [cloud-storage-docs]: https://cloud.google.com/storage/docs/overview [cloud-storage-create-bucket]: https://cloud.google.com/storage/docs/cloud-console#_creatingbuckets -[storage-api]: http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/storage/package-summary.html +[storage-api]: http://googlecloudplatform.github.io/gcloud-java/0.0.7/apidocs/index.html?com/google/gcloud/storage/package-summary.html diff --git a/utilities/update_version.sh b/utilities/update_version.sh new file mode 100644 index 000000000000..1a71f67f4bf2 --- /dev/null +++ b/utilities/update_version.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# This script updates the READMEs with the latest non-SNAPSHOT version number and increments the SNAPSHOT +# version number in the pom.xml files. + +# Precondition: the pom.xml is at a "-SNAPSHOT" version before running this script. +# Argument (optional): +# $1: new version number for pom.xml files (do not include -SNAPSHOT, that is done automatically). +# Providing no argument defaults to incrementing revision number from x.y.z-SNAPSHOT to x.y.z+1-SNAPSHOT + +# Example: Suppose that before running this script, the pom reads 7.8.9-SNAPSHOT. This script will replace +# all occurrences of #.#.# with 7.8.9 in the README files and the first occurrence of 7.8.9-SNAPSHOT with +# 7.8.10-SNAPSHOT in the pom.xml files. + +# Get the previous maven project version. +CURRENT_SNAPSHOT=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '(^\[|\w+:)') +RELEASED_VERSION=${CURRENT_SNAPSHOT%%"-"*} +DEFAULT_UPDATE="${RELEASED_VERSION%.*}.$((${RELEASED_VERSION##*.}+1))" +NEW_SNAPSHOT_VERSION=${1:-$DEFAULT_UPDATE}-SNAPSHOT + +echo "Changing version to $RELEASED_VERSION in README files" +echo "Changing version to $NEW_SNAPSHOT_VERSION in pom.xml files" + +sed -ri "s/[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*/$RELEASED_VERSION/g" README.md +sed -ri "s/[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*/$RELEASED_VERSION/g" gcloud-java/README.md +sed -ri "s/[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*/$RELEASED_VERSION/g" gcloud-java-core/README.md +sed -ri "s/[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*/$RELEASED_VERSION/g" gcloud-java-datastore/README.md +sed -ri "s/[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*/$RELEASED_VERSION/g" gcloud-java-examples/README.md +sed -ri "s/[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*/$RELEASED_VERSION/g" gcloud-java-storage/README.md + +sed -i "0,/$CURRENT_SNAPSHOT/s/$CURRENT_SNAPSHOT/$NEW_SNAPSHOT_VERSION/g" pom.xml +sed -i "0,/$CURRENT_SNAPSHOT/s/$CURRENT_SNAPSHOT/$NEW_SNAPSHOT_VERSION/g" gcloud-java/pom.xml +sed -i "0,/$CURRENT_SNAPSHOT/s/$CURRENT_SNAPSHOT/$NEW_SNAPSHOT_VERSION/g" gcloud-java-core/pom.xml +sed -i "0,/$CURRENT_SNAPSHOT/s/$CURRENT_SNAPSHOT/$NEW_SNAPSHOT_VERSION/g" gcloud-java-datastore/pom.xml +sed -i "0,/$CURRENT_SNAPSHOT/s/$CURRENT_SNAPSHOT/$NEW_SNAPSHOT_VERSION/g" gcloud-java-examples/pom.xml +sed -i "0,/$CURRENT_SNAPSHOT/s/$CURRENT_SNAPSHOT/$NEW_SNAPSHOT_VERSION/g" gcloud-java-storage/pom.xml