From d9abc532c6bf0409404602da98ae96d883f7f964 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Tue, 4 Jun 2019 23:46:23 -0400 Subject: [PATCH 01/12] wip: Release versioning script with marker tags. Introduces bump.sh which supports moving from version to version but only within delimiting marker tags in the target file. This script currently doesn't do validations or anything fancy. --- bin/utils/release/bump.sh | 168 ++++++++++++++++++ .../{ => release}/release_version_update.sh | 42 ++--- .../release_version_update_docs.sh | 11 +- bin/utils/release/testing.txt | 17 ++ modules/openapi-generator-cli/pom.xml | 2 + modules/openapi-generator-core/pom.xml | 2 + .../gradle.properties | 2 + .../openapi-generator-gradle-plugin/pom.xml | 2 + .../openapi-generator-maven-plugin/pom.xml | 2 + modules/openapi-generator-online/pom.xml | 2 + modules/openapi-generator/pom.xml | 2 + pom.xml | 2 + samples/meta-codegen/lib/pom.xml | 2 + 13 files changed, 232 insertions(+), 24 deletions(-) create mode 100755 bin/utils/release/bump.sh rename bin/utils/{ => release}/release_version_update.sh (60%) rename bin/utils/{ => release}/release_version_update_docs.sh (89%) create mode 100644 bin/utils/release/testing.txt diff --git a/bin/utils/release/bump.sh b/bin/utils/release/bump.sh new file mode 100755 index 000000000000..348896f1f5ab --- /dev/null +++ b/bin/utils/release/bump.sh @@ -0,0 +1,168 @@ +#!/usr/bin/env bash +# +# This script bumps from one version to another +# +# Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +declare -r version_regex="([0-9]+).([0-9]+).([0-9]+)-?(SNAPSHOT){0,1}" +declare start="" +declare end="" +declare from="${version_regex}" +declare to="" +declare file="" +declare debug=${debug:-false} +declare -a from_parts=() +declare -a to_parts=() + +USAGE=" +USAGE: $0 OPTIONS input_file + + This script will bump a version number (or other value) between marker tags. + +OPTIONS: + -f The 'from' version + -t The 'to' version + -s The start tag regex + default: $start + -e The end tag regex + default: $end + -h Print this message + +EXAMPLES: + +Update to next snapshot version: + $0 -f 3.0.0 -t 3.0.1-SNAPSHOT pom.xml +Update build version only (useful for docs) + $0 -f 3.0.0 -t 3.0.1 pom.xml +Update from any version to any other version + $0 -f 1.2.3 -t 9.9.9-SNAPSHOT pom.xml +Customize the start/end tags + $0 -f 1.0.0 1.0.1-SNAPSHOT -s \"\" -e \"\" pom.xml +" + + +## print an error message and exit +err() { + >&2 echo -e "$1" + exit 1 +} + +## debug log messages. Run with debug=true ./bump.sh +d() { + if [[ true = "${debug}" ]]; then + echo "$1" + fi +} + +## outputs usage and exits +usage() +{ + err "${USAGE}" + exit 1 +} + +## usage: version input extracted_array +## - Checks that 'input' is a valid version +## - Extracts the version parts into 'extracted_array' +version() +{ + if [[ "$#" -ne 2 ]]; then + err "Call function version with two parameters: version string arr" + fi + local v=$1 + if [[ "${v}" =~ $version_regex ]]; then + local major=${BASH_REMATCH[1]} + local minor=${BASH_REMATCH[2]} + local build=${BASH_REMATCH[3]} + local snapshot=false + if [[ "SNAPSHOT" = "${BASH_REMATCH[4]}" ]]; then + snapshot=true + fi + + d "major=$major minor=$minor build=$build snapshot=$snapshot" + + eval "$2=(${major} ${minor} ${build} ${snapshot})" + else + err "Invalid version: $v" + fi +} + +while getopts "hf:t:s:e:" OPTION +do + case ${OPTION} in + f) + from=${OPTARG} + ;; + t) + to=${OPTARG} + ;; + s) + start=${OPTARG} + ;; + e) + end=${OPTARG} + ;; + h) + usage + ;; + esac +done + +shift $((OPTIND-1)) +file="${1}" + +if [[ -z "${file}" ]];then + echo "No file specified" >&2 + usage +fi + +if [[ -z "${from}" ]]; then + err "No 'from' version specified." +fi +if [[ -z "${to}" ]]; then + err "No 'to' version specified." +fi + +# TODO: compare steps in from_parts and to_parts. +# This could be further automated to support bump levels (major/minor/build/SNAPSHOT) +version "${from}" from_parts +version "${to}" to_parts + +if [[ ${from_parts[3]} = true && ${to_parts[3]} = true ]]; then + err "Moving from SNAPSHOT to SNAPSHOT is not supported." +fi + +cat < sedscript.sed +/${start}/,/${end}/{ + s/${from}/${to}/ +} +EOF + +trap 'rm -f sedscript.sed' EXIT + +sed_cross () { + # Cross-platform sed invocation + sed --version >/dev/null 2>&1 && sed -E -i '' -f sedscript.sed "$@" || sed -i '' -f sedscript.sed "$@" +} + +d "Moving from ${from} to ${to}: $file" + +if sed_cross $file; then + echo "Updated $file successfully!" +else + echo "ERROR: Failed to update $file to target version ${to}" >&2 +fi + diff --git a/bin/utils/release_version_update.sh b/bin/utils/release/release_version_update.sh similarity index 60% rename from bin/utils/release_version_update.sh rename to bin/utils/release/release_version_update.sh index c485fc589c94..693ac93ea87d 100755 --- a/bin/utils/release_version_update.sh +++ b/bin/utils/release/release_version_update.sh @@ -1,6 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash # -# usage: ./bin/utils/release_version_update.sh 3.0.1-SNAPSHOT 3.0.1 +# This script is used to update files to the "latest" version. +# +# usage: ./bin/utils/release_version_update.sh +# example: ./bin/utils/release_version_update.sh 3.0.1-SNAPSHOT 3.0.1 # # Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) # @@ -17,6 +20,8 @@ # limitations under the License. # +declare cwd=$(cd $(dirname "${BASH_SOURCE}") && pwd) + if [[ "$1" != "" ]]; then FROM="$1" else @@ -33,10 +38,9 @@ fi echo "Release preparation: replacing $FROM with $TO in different files" -# This script assumes the files defined here have a version surrounded by angle brackets within an xml node. -# For example, >4.0.0< becomes >4.0.1-SNAPSHOT<. -# Verify the sed command below against a file before adding here. -declare -a files=("modules/openapi-generator-cli/pom.xml" +# These files should wrap target version replacement blocks with and +# We can include xml and md files here. +declare -a xml_files=("modules/openapi-generator-cli/pom.xml" "modules/openapi-generator-gradle-plugin/pom.xml" "modules/openapi-generator-core/pom.xml" "modules/openapi-generator-maven-plugin/pom.xml" @@ -45,18 +49,16 @@ declare -a files=("modules/openapi-generator-cli/pom.xml" "samples/meta-codegen/lib/pom.xml" "pom.xml") -sedi () { - # Cross-platform version of sed -i that works both on Mac and Linux - sed --version >/dev/null 2>&1 && sed -i -e "$@" || sed -i "" "$@" -} - -for filename in "${files[@]}"; do - # e.g. sed -i '' "s/3.0.1-SNAPSHOT/3.0.1/g" CI/pom.xml.bash - #echo "Running command: sed -i '' "s/$FROM/$TO/g" $filename" - if sedi "s/>$FROM$TO +# example: ./bin/utils/release_version_update.sh 3.0.1 3.0.2 # # Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) # @@ -20,14 +23,14 @@ if [[ "$1" != "" ]]; then FROM="$1" else - echo "Missing argument. Usage e.g.: ./bin/utils/release_version_update.sh 3.0.1-SNAPSHOT 3.0.1" + echo "Missing argument. Usage e.g.: ./bin/utils/release_version_update.sh 3.0.1 3.0.2" exit 1; fi if [[ "$2" != "" ]]; then TO="$2" else - echo "Missing argument. Usage e.g.: ./bin/utils/release_version_update.sh 3.0.1-SNAPSHOT 3.0.1" + echo "Missing argument. Usage e.g.: ./bin/utils/release_version_update.sh 3.0.1 3.0.2" exit 1; fi diff --git a/bin/utils/release/testing.txt b/bin/utils/release/testing.txt new file mode 100644 index 000000000000..300bdac6f68c --- /dev/null +++ b/bin/utils/release/testing.txt @@ -0,0 +1,17 @@ +This is a test simple: +3.0.1 + +Testing with other data: + +Version 1.2.3 + + +Testing with -SNAPSHOT data: + +Version 2.3.4-SNAPSHOT + + +Testing with a value not to be replaced: + +Version 3.2.2 + diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index 982519998163..c02b6e8ab1ac 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -3,7 +3,9 @@ org.openapitools openapi-generator-project + 4.0.2-SNAPSHOT + ../.. 4.0.0 diff --git a/modules/openapi-generator-core/pom.xml b/modules/openapi-generator-core/pom.xml index d5cb2acecaa6..e36eba121156 100644 --- a/modules/openapi-generator-core/pom.xml +++ b/modules/openapi-generator-core/pom.xml @@ -5,7 +5,9 @@ openapi-generator-project org.openapitools + 4.0.2-SNAPSHOT + ../.. 4.0.0 diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties index e07dd0df32da..925e6248aece 100644 --- a/modules/openapi-generator-gradle-plugin/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/gradle.properties @@ -1,4 +1,6 @@ +# RELEASE_VERSION openApiGeneratorVersion=4.0.2-SNAPSHOT +# /RELEASE_VERSION # BEGIN placeholders # these are just placeholders to allow contributors to build directly diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index 507cfb120b32..4da415abea59 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -3,7 +3,9 @@ org.openapitools openapi-generator-project + 4.0.2-SNAPSHOT + ../.. 4.0.0 diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index 45705f5586a6..fc14d8d34533 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -4,7 +4,9 @@ org.openapitools openapi-generator-project + 4.0.2-SNAPSHOT + ../.. openapi-generator-maven-plugin diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index cfde6839ac04..77b1c9771d3e 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -3,7 +3,9 @@ org.openapitools openapi-generator-project + 4.0.2-SNAPSHOT + ../.. openapi-generator-online diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index 7cf23e26d823..85ebccd290be 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -3,7 +3,9 @@ org.openapitools openapi-generator-project + 4.0.2-SNAPSHOT + ../.. 4.0.0 diff --git a/pom.xml b/pom.xml index bb23a1f98744..be576dc7f037 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,9 @@ openapi-generator-project pom openapi-generator-project + 4.0.2-SNAPSHOT + https://github.com/openapitools/openapi-generator scm:git:git@github.com:openapitools/openapi-generator.git diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index 0d7c935fe1b2..a17b342d0b9e 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -121,7 +121,9 @@ UTF-8 + 4.0.2-SNAPSHOT + 1.0.0 4.8.1 From 8a2cae6a355d66167f8ed104413643d56728bded Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 5 Jun 2019 15:16:48 -0400 Subject: [PATCH 02/12] Include multi-file testing txts --- bin/utils/release/testing2.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 bin/utils/release/testing2.txt diff --git a/bin/utils/release/testing2.txt b/bin/utils/release/testing2.txt new file mode 100644 index 000000000000..300bdac6f68c --- /dev/null +++ b/bin/utils/release/testing2.txt @@ -0,0 +1,17 @@ +This is a test simple: +3.0.1 + +Testing with other data: + +Version 1.2.3 + + +Testing with -SNAPSHOT data: + +Version 2.3.4-SNAPSHOT + + +Testing with a value not to be replaced: + +Version 3.2.2 + From f1a0fe3e16258d5f7544e7b7eb86b93bd550fbbd Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 5 Jun 2019 16:34:59 -0400 Subject: [PATCH 03/12] WIP: allow bumping version according to type (major,minor,build,revision) --- bin/utils/release/bump.sh | 71 ++++++++++++++++----- bin/utils/release/release_version_update.sh | 62 ++++++++++++------ 2 files changed, 97 insertions(+), 36 deletions(-) diff --git a/bin/utils/release/bump.sh b/bin/utils/release/bump.sh index 348896f1f5ab..c77ff637b91d 100755 --- a/bin/utils/release/bump.sh +++ b/bin/utils/release/bump.sh @@ -22,10 +22,10 @@ declare start="" declare end="" declare from="${version_regex}" declare to="" -declare file="" declare debug=${debug:-false} declare -a from_parts=() declare -a to_parts=() +declare -ar inc=(major minor build snapshot) USAGE=" USAGE: $0 OPTIONS input_file @@ -39,6 +39,7 @@ OPTIONS: default: $start -e The end tag regex default: $end + -i Increase by one of: ${inc[@]} -h Print this message EXAMPLES: @@ -100,7 +101,7 @@ version() fi } -while getopts "hf:t:s:e:" OPTION +while getopts "hf:t:s:e:i:" OPTION do case ${OPTION} in f) @@ -115,6 +116,12 @@ do e) end=${OPTARG} ;; + i) + increase=${OPTARG} + if [[ ! "${inc[@]}" =~ ${increase} ]];then + err "Only support increasing by one of: ${inc[@]}" + fi + ;; h) usage ;; @@ -122,9 +129,9 @@ do done shift $((OPTIND-1)) -file="${1}" +file=( "$@" ) -if [[ -z "${file}" ]];then +if [[ ${#file[@]} -eq 0 ]];then echo "No file specified" >&2 usage fi @@ -132,14 +139,41 @@ fi if [[ -z "${from}" ]]; then err "No 'from' version specified." fi -if [[ -z "${to}" ]]; then - err "No 'to' version specified." -fi # TODO: compare steps in from_parts and to_parts. # This could be further automated to support bump levels (major/minor/build/SNAPSHOT) version "${from}" from_parts -version "${to}" to_parts + +if [[ -z "${to}" ]]; then + if [[ -z "${increase}" ]]; then + err "No 'to' version specified." + else + case ${increase} in + major) + to="$(( ${from_parts[0]} + 1 )).0.0" + version "$to" to_parts + ;; + minor) + to="${from_parts[0]}.$(( ${from_parts[1]} + 1 )).0" + version "$to" to_parts + ;; + build) + to="${from_parts[0]}.${from_parts[1]}.$(( ${from_parts[2]} + 1 ))" + version "$to" to_parts + ;; + snapshot) + if [[ true = ${from_parts[3]} ]]; then + err "Can't move from SNAPSHOT to SNAPSHOT (from=${from})." + else + to="${from_parts[0]}.${from_parts[1]}.$(( ${from_parts[2]} + 1 ))-SNAPSHOT" + version "$to" to_parts + fi + ;; + esac + fi +else + version "${to}" to_parts +fi if [[ ${from_parts[3]} = true && ${to_parts[3]} = true ]]; then err "Moving from SNAPSHOT to SNAPSHOT is not supported." @@ -151,18 +185,21 @@ cat < sedscript.sed } EOF +d "Moving from=${from} to=${to}" + trap 'rm -f sedscript.sed' EXIT sed_cross () { - # Cross-platform sed invocation - sed --version >/dev/null 2>&1 && sed -E -i '' -f sedscript.sed "$@" || sed -i '' -f sedscript.sed "$@" + # Cross-platform sed invocation. OSX has no option to show a version number in sed. + local target=$1 + sed --version >/dev/null 2>&1 && sed -e -i '' -f sedscript.sed "$target" || sed -i '' -E -f sedscript.sed "$target" } -d "Moving from ${from} to ${to}: $file" - -if sed_cross $file; then - echo "Updated $file successfully!" -else - echo "ERROR: Failed to update $file to target version ${to}" >&2 -fi +for filename in "${file[@]}"; do + if sed_cross ${filename}; then + echo "Updated $filename successfully!" + else + echo "ERROR: Failed to update $filename to target version ${to}" >&2 + fi +done diff --git a/bin/utils/release/release_version_update.sh b/bin/utils/release/release_version_update.sh index 693ac93ea87d..8462efa430a0 100755 --- a/bin/utils/release/release_version_update.sh +++ b/bin/utils/release/release_version_update.sh @@ -22,21 +22,51 @@ declare cwd=$(cd $(dirname "${BASH_SOURCE}") && pwd) -if [[ "$1" != "" ]]; then - FROM="$1" -else - echo "Missing argument. Usage e.g.: ./bin/utils/release_version_update.sh 3.0.1-SNAPSHOT 3.0.1" - exit 1; -fi +USAGE=" +USAGE: $0 target + + This script will convert the current version in target files to the specified 'target' + where target is one of: + + major + minor + build + snapshot + +EXAMPLES: -if [[ "$2" != "" ]]; then - TO="$2" +Update to new snapshot (1.0.0 -> 1.0.1-SNAPSHOT): + $0 snapshot +Update build version (1.0.0 -> 1.0.1) + $0 build +Update minor version (1.2.3 -> 1.3.0) + $0 minor +Update major version (1.2.3 -> 2.0.0) + $0 major +" + +version=$(ruby -r rexml/document -e 'include REXML; + p XPath.first(Document.new($stdin), "/project/version/text()")' < ${cwd}/../../../pom.xml) + +if [[ -n "$1" ]]; then + case $1 in + --help|-h) + echo -e "$USAGE" >&2 + exit 1 + ;; + major|minor|build|snapshot) + inc="$1" + ;; + *) + echo "Invalid target.Must be one of: major minor build or snapshot" >&2 + exit 1 + ;; + esac else - echo "Missing argument. Usage e.g.: ./bin/utils/release_version_update.sh 3.0.1-SNAPSHOT 3.0.1" - exit 1; + inc="snapshot" fi -echo "Release preparation: replacing $FROM with $TO in different files" +echo "Release preparation: Moving from $version to next $inc version." # These files should wrap target version replacement blocks with and # We can include xml and md files here. @@ -54,11 +84,5 @@ declare -a properties_files=( "modules/openapi-generator-gradle-plugin/gradle.properties" ) -for filename in "${xml_files[@]}"; do - ${cwd}/bump.sh -f $FROM -t $TO $filename -done - -for filename in "${properties_files[@]}"; do - ${cwd}/bump.sh -f $FROM -t $TO -s '# RELEASE_VERSION' -e '# \/RELEASE_VERSION' $filename -done - +${cwd}/bump.sh -f ${version} -i ${inc} ${xml_files[@]} +${cwd}/bump.sh -f ${version} -t ${inc} -s '# RELEASE_VERSION' -e '# \/RELEASE_VERSION' ${properties_files[@]} From 78e39d9121172a8d23c9b68bea045388ab4b9959 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 5 Jun 2019 18:11:51 -0400 Subject: [PATCH 04/12] WIP: Adjusting docs vs regular version update files --- bin/utils/release/release_version_update.sh | 5 + .../release/release_version_update_docs.sh | 125 ++++++++++++------ .../README.adoc | 5 +- .../samples/local-spec/gradle.properties | 4 +- .../openapi-generator-maven-plugin/README.md | 2 + .../examples/java-client.xml | 2 + .../examples/multi-module/java-client/pom.xml | 2 + .../examples/non-java-invalid-spec.xml | 2 + .../examples/non-java.xml | 2 + 9 files changed, 109 insertions(+), 40 deletions(-) diff --git a/bin/utils/release/release_version_update.sh b/bin/utils/release/release_version_update.sh index 8462efa430a0..fd53cf9b8ce0 100755 --- a/bin/utils/release/release_version_update.sh +++ b/bin/utils/release/release_version_update.sh @@ -76,12 +76,17 @@ declare -a xml_files=("modules/openapi-generator-cli/pom.xml" "modules/openapi-generator-maven-plugin/pom.xml" "modules/openapi-generator-online/pom.xml" "modules/openapi-generator/pom.xml" + "modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml" + "modules/openapi-generator-maven-plugin/examples/java-client.xml" + "modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml" + "modules/openapi-generator-maven-plugin/examples/non-java.xml" "samples/meta-codegen/lib/pom.xml" "pom.xml") # These files should wrap target version replacement blocks with # RELEASE_VERSION and # /RELEASE_VERSION declare -a properties_files=( "modules/openapi-generator-gradle-plugin/gradle.properties" + "modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties" ) ${cwd}/bump.sh -f ${version} -i ${inc} ${xml_files[@]} diff --git a/bin/utils/release/release_version_update_docs.sh b/bin/utils/release/release_version_update_docs.sh index f3696825bac2..7b8b223f0008 100755 --- a/bin/utils/release/release_version_update_docs.sh +++ b/bin/utils/release/release_version_update_docs.sh @@ -20,46 +20,95 @@ # limitations under the License. # -if [[ "$1" != "" ]]; then - FROM="$1" -else - echo "Missing argument. Usage e.g.: ./bin/utils/release_version_update.sh 3.0.1 3.0.2" - exit 1; +declare cwd=$(cd $(dirname "${BASH_SOURCE}") && pwd) + +USAGE=" +USAGE: $0 [version] target + + This script will convert the specified version in DOC target files to the 'target' + where target is one of: + + major + minor + build + + or an explicitly defined version number. + +NOTE: + + Files prepped by this script should never target SNAPSHOT, as the docs should refer to release artifacts. + If intending to update to/from snapshots, please add target files to release_version_update.sh instead. + +EXAMPLES: + +Update build version (1.0.0 -> 1.0.1) + $0 build +Update minor version (1.2.3 -> 1.3.0) + $0 minor +Update major version (1.2.3 -> 2.0.0) + $0 major +" + +declare version=$(ruby -r rexml/document -e 'include REXML; + p XPath.first(Document.new($stdin), "/project/version/text()")' < ${cwd}/../../../pom.xml) + +declare target="${2:-build}" +declare inc="" +declare next_version="" +declare ags="" + +if [[ -z "$1" ]]; then + echo "Missing argument." >&2 + echo -e "$USAGE" >&2 + exit 1 fi -if [[ "$2" != "" ]]; then - TO="$2" +# Get version number we're changing +case $1 in + --help|-h) + echo -e "$USAGE" >&2 + exit 1 + ;; + *) + version="$1" + ;; +esac + +# Get the target… +case ${target} in + major|minor|build) + inc="$target" + ;; + snapshot) + echo -e "Files prepped by this script should never target SNAPSHOT, as the docs should refer to release artifacts. + If intending to update to/from snapshots, please add target files to release_version_update.sh instead. + " >&2 + exit 1 + ;; + *) + next_version="$target" + ;; +esac + +ags="-f ${version}" + +if [[ -n "${next_version}" ]];then + echo "Release preparation: Moving from $version to ${next_version}." + ags="$ags -t ${next_version}" else - echo "Missing argument. Usage e.g.: ./bin/utils/release_version_update.sh 3.0.1 3.0.2" - exit 1; + echo "Release preparation: Moving from $version to next $inc version." + ags="$ags -i ${inc}" fi -echo "Release preparation: replacing $FROM with $TO in different files" - -declare -a files=("modules/openapi-generator-maven-plugin/README.md" - "modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml" - "modules/openapi-generator-maven-plugin/examples/java-client.xml" - "modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml" - "modules/openapi-generator-maven-plugin/examples/non-java.xml" - "modules/openapi-generator-gradle-plugin/README.adoc" - "modules/openapi-generator-gradle-plugin/gradle.properties" - "modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties" - "modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle" - "modules/openapi-generator-gradle-plugin/samples/local-spec/README.md" - "README.md") - -sedi () { - # Cross-platform version of sed -i that works both on Mac and Linux - sed --version >/dev/null 2>&1 && sed -i -e "$@" || sed -i "" "$@" -} - -for filename in "${files[@]}"; do - # e.g. sed -i '' "s/3.0.1-SNAPSHOT/3.0.1/g" CI/pom.xml.bash - #echo "Running command: sed -i '' "s/$FROM/$TO/g" $filename" - if sedi "s/$FROM/$TO/g" $filename; then - echo "Updated $filename successfully!" - else - echo "ERROR: Failed to update $filename with the following command" - echo "sed -i '' \"s/$FROM/$TO/g\" $filename" - fi -done +declare -a xml_files=( + "modules/openapi-generator-maven-plugin/README.md" + "modules/openapi-generator-gradle-plugin/samples/local-spec/README.md" + "README.md" +) + +declare -a commented_files=( + "modules/openapi-generator-gradle-plugin/README.adoc" +) + +${cwd}/bump.sh ${ags} ${xml_files[@]} +${cwd}/bump.sh ${ags} -s '# RELEASE_VERSION' -e '# \/RELEASE_VERSION' ${commented_files[@]} diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc index 47200a6754c0..d3ef91ee5356 100644 --- a/modules/openapi-generator-gradle-plugin/README.adoc +++ b/modules/openapi-generator-gradle-plugin/README.adoc @@ -39,7 +39,7 @@ compileJava.dependsOn tasks.openApiGenerate ==== == Plugin Setup - +//# RELEASE_VERSION [source,groovy] ---- buildscript { @@ -54,6 +54,7 @@ buildscript { apply plugin: 'org.openapi.generator' ---- +//# /RELEASE_VERSION [NOTE] ==== @@ -591,6 +592,7 @@ Android Studio may experience a Windows-specific Guava dependency conflict with As a workaround, you may force exclude conflicting Guava dependencies. +//# RELEASE_VERSION ```gradle buildscript { repositories { @@ -612,5 +614,6 @@ configurations { // … apply plugin: 'org.openapi.generator' ``` +//# /RELEASE_VERSION See https://github.com/OpenAPITools/openapi-generator/issues/1818[OpenAPITools/openapi-generator#1818] for more details. diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties index 11f18bc06edc..9c1aea5a9593 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties @@ -1 +1,3 @@ -openApiGeneratorVersion=4.0.1 +# RELEASE_VERSION +openApiGeneratorVersion=4.0.2-SNAPSHOT +# /RELEASE_VERSION diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md index bcf211db7d4e..8df7a29e0b65 100644 --- a/modules/openapi-generator-maven-plugin/README.md +++ b/modules/openapi-generator-maven-plugin/README.md @@ -11,7 +11,9 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase) org.openapitools openapi-generator-maven-plugin + 4.0.1 + diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml index 0d6d91acadd9..17f77269da93 100644 --- a/modules/openapi-generator-maven-plugin/examples/java-client.xml +++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml @@ -12,7 +12,9 @@ org.openapitools openapi-generator-maven-plugin + 4.0.2-SNAPSHOT + diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml index 1b1e28ee071d..43873375fe5b 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml @@ -18,7 +18,9 @@ org.openapitools openapi-generator-maven-plugin + 4.0.2-SNAPSHOT + ${project.groupId} diff --git a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml index 06f7f10c733e..9c099d7f9990 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml @@ -12,7 +12,9 @@ org.openapitools openapi-generator-maven-plugin + 4.0.2-SNAPSHOT + diff --git a/modules/openapi-generator-maven-plugin/examples/non-java.xml b/modules/openapi-generator-maven-plugin/examples/non-java.xml index 6f8fbec5c450..413899ba80bb 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java.xml @@ -12,7 +12,9 @@ org.openapitools openapi-generator-maven-plugin + 4.0.2-SNAPSHOT + From 8538a5a11b771a99c301eff54700a996889ba101 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 5 Jun 2019 19:13:24 -0400 Subject: [PATCH 05/12] Include README.md for doc updates --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b43c267dee31..8c7b5566b299 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ OpenAPI Generator Version | Release Date | Notes 5.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.0.0-SNAPSHOT/)| 13.05.2020 | Major release with breaking changes (no fallback) 4.1.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.1.0-SNAPSHOT/)| 15.07.2019 | Minor release (breaking changes with fallbacks) 4.0.2 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.0.1-SNAPSHOT/)| 15.06.2019 | Patch release (minor bug fixes, etc) -[4.0.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.0.1) (latest stable release) | 31.05.2019 | Patch release (bug fixes, minor enhancements, etc) +[4.0.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.0.1) (latest stable release) | 31.05.2019 | Patch release (bug fixes, minor enhancements, etc) OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0 @@ -153,7 +153,7 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository. * [Readme](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-gradle-plugin/README.adoc) ### [1.3 - Download JAR](#table-of-contents) - + If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum): JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.0.1/openapi-generator-cli-4.0.1.jar` @@ -175,7 +175,7 @@ For Mac users, please make sure Java 8 is installed (Tips: run `java -version` t export JAVA_HOME=`/usr/libexec/java_home -v 1.8` export PATH=${JAVA_HOME}/bin:$PATH ``` - + ### Launcher Script One downside to manual jar downloads is that you don't keep up-to-date with the latest released version. We have a Bash launcher script at [bin/utils/openapi-generator.cli.sh](./bin/utils/openapi-generator-cli.sh) which resolves this issue. @@ -367,8 +367,8 @@ Install it globally to get the CLI available on the command line: npm install @openapitools/openapi-generator-cli -g openapi-generator version ``` - -Or install a particualar OpenAPI Generator version (e.g. v4.0.1): + +Or install a particular OpenAPI Generator version (e.g. v4.0.1): ```sh npm install @openapitools/openapi-generator-cli@cli-4.0.1 -g @@ -379,7 +379,7 @@ Or install it as dev-dependency: ```sh npm install @openapitools/openapi-generator-cli -D ``` - + ## [2 - Getting Started](#table-of-contents) To generate a PHP client for [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml), please run the following @@ -393,9 +393,9 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat -o /var/tmp/php_api_client ``` (if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php -o c:\temp\php_api_client`) - + You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.0.1/openapi-generator-cli-4.0.1.jar) - + To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate` To get a list of PHP specified options (which can be passed to the generator with a config file via the `-c` option), please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar config-help -g php` From bebc9f130483f521c9b01a1befb2d0f9873ce4c8 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 5 Jun 2019 19:16:53 -0400 Subject: [PATCH 06/12] Set root of file paths so scripts can be run from any locaiton --- bin/utils/release/release_version_update.sh | 27 ++++++++++--------- .../release/release_version_update_docs.sh | 9 ++++--- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/bin/utils/release/release_version_update.sh b/bin/utils/release/release_version_update.sh index fd53cf9b8ce0..df9d80ca341f 100755 --- a/bin/utils/release/release_version_update.sh +++ b/bin/utils/release/release_version_update.sh @@ -21,6 +21,7 @@ # declare cwd=$(cd $(dirname "${BASH_SOURCE}") && pwd) +declare root=$(cd "$cwd" && cd ../../../ && pwd) USAGE=" USAGE: $0 target @@ -71,22 +72,22 @@ echo "Release preparation: Moving from $version to next $inc version." # These files should wrap target version replacement blocks with and # We can include xml and md files here. declare -a xml_files=("modules/openapi-generator-cli/pom.xml" - "modules/openapi-generator-gradle-plugin/pom.xml" - "modules/openapi-generator-core/pom.xml" - "modules/openapi-generator-maven-plugin/pom.xml" - "modules/openapi-generator-online/pom.xml" - "modules/openapi-generator/pom.xml" - "modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml" - "modules/openapi-generator-maven-plugin/examples/java-client.xml" - "modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml" - "modules/openapi-generator-maven-plugin/examples/non-java.xml" - "samples/meta-codegen/lib/pom.xml" - "pom.xml") + "${root}/modules/openapi-generator-gradle-plugin/pom.xml" + "${root}/modules/openapi-generator-core/pom.xml" + "${root}/modules/openapi-generator-maven-plugin/pom.xml" + "${root}/modules/openapi-generator-online/pom.xml" + "${root}/modules/openapi-generator/pom.xml" + "${root}/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml" + "${root}/modules/openapi-generator-maven-plugin/examples/java-client.xml" + "${root}/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml" + "${root}/modules/openapi-generator-maven-plugin/examples/non-java.xml" + "${root}/samples/meta-codegen/lib/pom.xml" + "${root}/pom.xml") # These files should wrap target version replacement blocks with # RELEASE_VERSION and # /RELEASE_VERSION declare -a properties_files=( - "modules/openapi-generator-gradle-plugin/gradle.properties" - "modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties" + "${root}/modules/openapi-generator-gradle-plugin/gradle.properties" + "${root}/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties" ) ${cwd}/bump.sh -f ${version} -i ${inc} ${xml_files[@]} diff --git a/bin/utils/release/release_version_update_docs.sh b/bin/utils/release/release_version_update_docs.sh index 7b8b223f0008..76a733a13bd7 100755 --- a/bin/utils/release/release_version_update_docs.sh +++ b/bin/utils/release/release_version_update_docs.sh @@ -21,6 +21,7 @@ # declare cwd=$(cd $(dirname "${BASH_SOURCE}") && pwd) +declare root=$(cd "$cwd" && cd ../../../ && pwd) USAGE=" USAGE: $0 [version] target @@ -101,13 +102,13 @@ else fi declare -a xml_files=( - "modules/openapi-generator-maven-plugin/README.md" - "modules/openapi-generator-gradle-plugin/samples/local-spec/README.md" - "README.md" + "${root}/modules/openapi-generator-maven-plugin/README.md" + "${root}/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md" + "${root}/README.md" ) declare -a commented_files=( - "modules/openapi-generator-gradle-plugin/README.adoc" + "${root}/modules/openapi-generator-gradle-plugin/README.adoc" ) ${cwd}/bump.sh ${ags} ${xml_files[@]} From 07932889eac57b73ad48553c42095fb344cc49bf Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 5 Jun 2019 19:19:52 -0400 Subject: [PATCH 07/12] Fix double quoting of queried version --- bin/utils/release/release_version_update.sh | 2 +- bin/utils/release/release_version_update_docs.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/utils/release/release_version_update.sh b/bin/utils/release/release_version_update.sh index df9d80ca341f..9c34d202c93d 100755 --- a/bin/utils/release/release_version_update.sh +++ b/bin/utils/release/release_version_update.sh @@ -47,7 +47,7 @@ Update major version (1.2.3 -> 2.0.0) " version=$(ruby -r rexml/document -e 'include REXML; - p XPath.first(Document.new($stdin), "/project/version/text()")' < ${cwd}/../../../pom.xml) + p XPath.first(Document.new($stdin), "/project/version/text()")' < ${cwd}/../../../pom.xml | tr -d '"') if [[ -n "$1" ]]; then case $1 in diff --git a/bin/utils/release/release_version_update_docs.sh b/bin/utils/release/release_version_update_docs.sh index 76a733a13bd7..2fabcdf805a1 100755 --- a/bin/utils/release/release_version_update_docs.sh +++ b/bin/utils/release/release_version_update_docs.sh @@ -51,7 +51,7 @@ Update major version (1.2.3 -> 2.0.0) " declare version=$(ruby -r rexml/document -e 'include REXML; - p XPath.first(Document.new($stdin), "/project/version/text()")' < ${cwd}/../../../pom.xml) + p XPath.first(Document.new($stdin), "/project/version/text()")' < ${cwd}/../../../pom.xml | tr -d '"') declare target="${2:-build}" declare inc="" From c8386d73b345b4e712ef2aa42ac303002d2a3483 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 5 Jun 2019 19:22:57 -0400 Subject: [PATCH 08/12] Multiline replacement via sed --- bin/utils/release/bump.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/utils/release/bump.sh b/bin/utils/release/bump.sh index c77ff637b91d..fcbd59bc25d1 100755 --- a/bin/utils/release/bump.sh +++ b/bin/utils/release/bump.sh @@ -181,7 +181,7 @@ fi cat < sedscript.sed /${start}/,/${end}/{ - s/${from}/${to}/ + s/${from}/${to}/g } EOF From 5dbd18032722c65c97e9e09bff8ffae6b978839b Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 5 Jun 2019 19:30:59 -0400 Subject: [PATCH 09/12] Add root folder to cli module pom --- bin/utils/release/release_version_update.sh | 26 +++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/bin/utils/release/release_version_update.sh b/bin/utils/release/release_version_update.sh index 9c34d202c93d..abc227a20278 100755 --- a/bin/utils/release/release_version_update.sh +++ b/bin/utils/release/release_version_update.sh @@ -71,18 +71,20 @@ echo "Release preparation: Moving from $version to next $inc version." # These files should wrap target version replacement blocks with and # We can include xml and md files here. -declare -a xml_files=("modules/openapi-generator-cli/pom.xml" - "${root}/modules/openapi-generator-gradle-plugin/pom.xml" - "${root}/modules/openapi-generator-core/pom.xml" - "${root}/modules/openapi-generator-maven-plugin/pom.xml" - "${root}/modules/openapi-generator-online/pom.xml" - "${root}/modules/openapi-generator/pom.xml" - "${root}/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml" - "${root}/modules/openapi-generator-maven-plugin/examples/java-client.xml" - "${root}/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml" - "${root}/modules/openapi-generator-maven-plugin/examples/non-java.xml" - "${root}/samples/meta-codegen/lib/pom.xml" - "${root}/pom.xml") +declare -a xml_files=( + "${root}/modules/openapi-generator-cli/pom.xml" + "${root}/modules/openapi-generator-gradle-plugin/pom.xml" + "${root}/modules/openapi-generator-core/pom.xml" + "${root}/modules/openapi-generator-maven-plugin/pom.xml" + "${root}/modules/openapi-generator-online/pom.xml" + "${root}/modules/openapi-generator/pom.xml" + "${root}/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml" + "${root}/modules/openapi-generator-maven-plugin/examples/java-client.xml" + "${root}/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml" + "${root}/modules/openapi-generator-maven-plugin/examples/non-java.xml" + "${root}/samples/meta-codegen/lib/pom.xml" + "${root}/pom.xml" +) # These files should wrap target version replacement blocks with # RELEASE_VERSION and # /RELEASE_VERSION declare -a properties_files=( From f717e90880217da9060dec2b261a7a5ba41d2489 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 5 Jun 2019 21:12:30 -0400 Subject: [PATCH 10/12] Update help text in release_version_update_docs.sh --- bin/utils/release/release_version_update_docs.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/utils/release/release_version_update_docs.sh b/bin/utils/release/release_version_update_docs.sh index 2fabcdf805a1..287b9a3e7dfc 100755 --- a/bin/utils/release/release_version_update_docs.sh +++ b/bin/utils/release/release_version_update_docs.sh @@ -24,7 +24,7 @@ declare cwd=$(cd $(dirname "${BASH_SOURCE}") && pwd) declare root=$(cd "$cwd" && cd ../../../ && pwd) USAGE=" -USAGE: $0 [version] target +USAGE: $0 version target This script will convert the specified version in DOC target files to the 'target' where target is one of: @@ -43,11 +43,11 @@ NOTE: EXAMPLES: Update build version (1.0.0 -> 1.0.1) - $0 build + $0 1.0.0 build Update minor version (1.2.3 -> 1.3.0) - $0 minor + $0 1.2.3 minor Update major version (1.2.3 -> 2.0.0) - $0 major + $0 1.2.3 major " declare version=$(ruby -r rexml/document -e 'include REXML; From 7f0813c135794ff579783894453883f73bcea54a Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Thu, 6 Jun 2019 08:30:32 -0400 Subject: [PATCH 11/12] bump.sh will now display error if file contents are unchanged --- bin/utils/release/bump.sh | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/bin/utils/release/bump.sh b/bin/utils/release/bump.sh index fcbd59bc25d1..1afeffde16b9 100755 --- a/bin/utils/release/bump.sh +++ b/bin/utils/release/bump.sh @@ -137,11 +137,11 @@ if [[ ${#file[@]} -eq 0 ]];then fi if [[ -z "${from}" ]]; then - err "No 'from' version specified." + echo "No 'from' version specified." >&2 + usage fi # TODO: compare steps in from_parts and to_parts. -# This could be further automated to support bump levels (major/minor/build/SNAPSHOT) version "${from}" from_parts if [[ -z "${to}" ]]; then @@ -189,17 +189,33 @@ d "Moving from=${from} to=${to}" trap 'rm -f sedscript.sed' EXIT -sed_cross () { +sed_cross() { # Cross-platform sed invocation. OSX has no option to show a version number in sed. local target=$1 sed --version >/dev/null 2>&1 && sed -e -i '' -f sedscript.sed "$target" || sed -i '' -E -f sedscript.sed "$target" } -for filename in "${file[@]}"; do - if sed_cross ${filename}; then - echo "Updated $filename successfully!" - else +update_file() { + local filename=$1 + local error_message="ERROR: Failed to update $filename to target version ${to}" + local original_hash=$(ruby -r digest -e "p Digest::SHA2.file(\"$filename\").hexdigest") + local final_hash="" + if ! sed_cross ${filename}; then + # occurs if, for example, the file doesn't exist. echo "ERROR: Failed to update $filename to target version ${to}" >&2 fi + + local final_hash=$(ruby -r digest -e "p Digest::SHA2.file(\"$filename\").hexdigest") + + if [[ "${original_hash}" = "${final_hash}" ]]; then + # occurs if, for example, the file doesn't have expected marker tags for replacement + echo "ERROR: $filename was not modified." >&2 + else + echo "Updated $filename successfully!" + fi +} + +for filename in "${file[@]}"; do + update_file ${filename} done From 8b1bfee67732185e298650e2db95895fe3b68262 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Mon, 24 Jun 2019 12:21:36 -0400 Subject: [PATCH 12/12] Undo changes to the generated samples/meta-codegen/lib/pom.xml --- samples/meta-codegen/lib/pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index 99e84c5667cd..e48c8f444e0e 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -121,9 +121,7 @@ UTF-8 - 4.0.3-SNAPSHOT - 1.0.0 4.8.1