Skip to content

Commit

Permalink
ICU-22534 Script preparing the GitHub icu4j release files
Browse files Browse the repository at this point in the history
See #2665
  • Loading branch information
mihnita committed Oct 6, 2023
1 parent 2e9d128 commit 049c8ad
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 14 deletions.
1 change: 1 addition & 0 deletions docs/processes/release/tasks/versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ Edit the root pom file at `icu4j/pom.xml` and manually make this change:
5. Update the following variables in `icu4j/releases_tools/shared.sh`

* `artifact_version` - The version used in the Maven `pom.xml` files. You can alternatively produce this value by running `mvn help:evaluate -Dexpression=project.version -q -DforceStdout`.
* `github_rel_version` - The version used in the name of the GitHub downloadable artifacts. For example "73_2" or "74rc".
* `api_report_version` - The major version of the new version. Change during RC BRS.
* `api_report_prev_version` - The major version of the previous version. Change during RC BRS.

Expand Down
14 changes: 0 additions & 14 deletions icu4j/releases_tools/api_reports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@ if [ ! -f "releases_tools/shared.sh" ]; then
fi
. releases_tools/shared.sh

function checkThatJdk8IsDefault() {
javac -version appPath 2>&1 | grep -E 'javac 1\.8\.' > /dev/null
if [ $? -eq 0 ]; then
echo "The default JDK version is 8, all good!"
javac -version
else
echo "This step can only be executed with JDK 8!"
echo "Make sure that you have the PATH pointing to a JDK 8!"
javac -version
exit
fi

}

# ====================================================================================
# The start of the script proper

Expand Down
56 changes: 56 additions & 0 deletions icu4j/releases_tools/github_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env bash
# Copyright (C) 2023 and later: Unicode, Inc. and others.
# License & terms of use: http:https://www.unicode.org/copyright.html

if [ ! -f "releases_tools/shared.sh" ]; then
echo "ERROR: This script should be executed while being in the icu4j folder"
exit
fi
. releases_tools/shared.sh

function copyArtifactForGithubRelease() {
local artifactId=$1
# Copy artifacts in the output folder
mvn dependency:copy -q -Dmdep.stripVersion=true -Dartifact=com.ibm.icu:${artifactId}:${artifact_version} -DoutputDirectory=${release_folder}
mvn dependency:copy -q -Dmdep.stripVersion=true -Dartifact=com.ibm.icu:${artifactId}:${artifact_version}:jar:sources -DoutputDirectory=${release_folder}
# Change the names
mv ${release_folder}/${artifactId}.jar ${release_folder}/${artifactId}-${github_rel_version}.jar
mv ${release_folder}/${artifactId}-sources.jar ${release_folder}/${artifactId}-${github_rel_version}-sources.jar
}

# ====================================================================================
# The start of the script proper

release_folder=${out_dir}/github_release
# We still need JDK 8 to generate the javadoc (because of the doclets)
checkThatJdk8IsDefault

# ====================================================================================
# Build artifacts and copy them in the output folder

reportTitle Prepare folder with artifacts for GitHub release

mvn clean install -DskipITs -DskipTests -P with_sources

rm -fr ${release_folder}
mkdir -p ${release_folder}
copyArtifactForGithubRelease icu4j
copyArtifactForGithubRelease icu4j-charset
copyArtifactForGithubRelease icu4j-localespi

# ====================================================================================
# Build complete javadoc and copy it in the output folder

reportTitle Prepare complete javadoc for GitHub release

mvn site -DskipITs -DskipTests -P with_full_javadoc

jar -Mcf ${release_folder}/icu4j-${github_rel_version}-javadoc.jar -C ${out_dir}/site/apidocs/ .

# ====================================================================================

pushd ${release_folder}
md5sum *.jar > icu4j-${github_rel_version}.md5
popd

reportTitle "You can find the results in ${release_folder}/"
1 change: 1 addition & 0 deletions icu4j/releases_tools/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export MAVEN_ARGS='--no-transfer-progress'

# Version update!
export artifact_version='74.1-SNAPSHOT'
export github_rel_version='74rc'
export api_report_version='74'
export api_report_prev_version='73'
export out_dir=target
Expand Down

0 comments on commit 049c8ad

Please sign in to comment.