forked from asciidoctor/asciidoctorj
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unnecessary 'gem' packaging during upstream gem installation. * Bump 'com.github.jruby-gradle.base' to v2.0.1 * Bump 'gem-maven-plugin' to v2.0.1 * Remove some unnecessary test files and configurations Fixes asciidoctor#1171
- Loading branch information
1 parent
0240f02
commit 7cc417e
Showing
6 changed files
with
58 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
# This script runs the AsciidoctorJ tests against the specified ref of the Asciidoctor Ruby gem. | ||
|
||
set -euo pipefail | ||
|
||
# to build against a tag, set REF to a git tag name (e.g., refs/tags/v1.5.2) | ||
REF=${1:-refs/heads/main} | ||
if [[ $REF != refs/* ]]; then | ||
REF=refs/heads/$REF | ||
fi | ||
readonly BASE_REF="${REF##*/}" | ||
readonly GEMS_INSTALL_PATH="asciidoctorj-core/build/.gems/gems" | ||
readonly SRC_DIR="asciidoctor-${BASE_REF#v}" | ||
# readonly WORKING_DIR="build/maven" | ||
|
||
rm -rf $WORKING_DIR && mkdir -p $WORKING_DIR | ||
# pushd $WORKING_DIR | ||
|
||
download_gem(){ | ||
} | ||
|
||
install_gem(){ | ||
./gradlew :asciidoctorj:jrubyPrepare | ||
|
||
wget --quiet -O "${SRC_DIR}.zip" "https://github.com/asciidoctor/asciidoctor/archive/${REF}.zip" | ||
unzip -q "${SRC_DIR}.zip" -d "$GEMS_INSTALL_PATH" | ||
|
||
ASCIIDOCTOR_UPSTREAM_VERSION="$(grep 'VERSION' "$GEMS_INSTALL_PATH/$SRC_DIR/lib/asciidoctor/version.rb" | sed "s/.*'\(.*\)'.*/\1/" | sed "s/[.]dev$/.dev-SNAPSHOT/")-SNAPSHOT" | ||
mv "$GEMS_INSTALL_PATH/$SRC_DIR" "$GEMS_INSTALL_PATH/asciidoctor-$ASCIIDOCTOR_UPSTREAM_VERSION" | ||
# DELETE previous release to ensure nothing leaks | ||
ASCIIDOCTOR_CURRENT_VERSION=$(./gradlew :asciidoctorj:properties | grep asciidoctorGemVersion | sed "s/.*:\s*\(.*\)\s*/\1/") | ||
rm -rf "$GEMS_INSTALL_PATH/asciidoctor-$ASCIIDOCTOR_CURRENT_VERSION" | ||
} | ||
|
||
install_gem | ||
|
||
./gradlew --no-daemon -S -Pskip.signing -PasciidoctorGemVersion="$ASCIIDOCTOR_UPSTREAM_VERSION" check | ||
|
||
cp ../../ci/asciidoctor-gem-installer.pom $SRC_DIR/pom.xml | ||
cd $SRC_DIR | ||
# force SNAPSHOT trailing to keep always consistency, gem-maven-plugin adds it depending on version format, breaking the build | ||
readonly ASCIIDOCTOR_VERSION="$(grep 'VERSION' ./lib/asciidoctor/version.rb | sed "s/.*'\(.*\)'.*/\1/" | sed "s/[.]dev$/.dev-SNAPSHOT/")-SNAPSHOT" | ||
# we don't use sed -i here for compatibility with OSX | ||
sed "s;<version></version>;<version>$ASCIIDOCTOR_VERSION</version>;" pom.xml > pom.xml.sedtmp && \ | ||
mv -f pom.xml.sedtmp pom.xml | ||
|
||
# we override the jruby version here with one supported by java9, additionally java9 needs some add-opens arguments that need to be ignored on older jvms | ||
mvn install -B --no-transfer-progress -Dgemspec="asciidoctor.gemspec" -Djruby.version=9.2.17.0 -Djruby.jvmargs="-XX:+IgnoreUnrecognizedVMOptions --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED" | ||
popd | ||
|
||
## Test against installed gem | ||
./gradlew --no-daemon -S -Pskip.signing -PasciidoctorGemVersion="$ASCIIDOCTOR_VERSION" -PuseMavenLocal=true check | ||
exit $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters