-
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.
Updated version with ability to generate JSONSchema
- Loading branch information
Showing
8 changed files
with
120 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,59 @@ | ||
set -e | ||
|
||
# Configuration | ||
GPG_USER="0xCED254CF741FE1663B9BEC32D12C9545C6D5AA73" | ||
|
||
# Evaluate Maven Coordinates | ||
|
||
mvn help:evaluate -Dexpression=project.groupId -Doutput=groupId.mvnhelp | ||
mvn help:evaluate -Dexpression=project.artifactId -Doutput=artifactId.mvnhelp | ||
mvn help:evaluate -Dexpression=project.version -Doutput=version.mvnhelp | ||
|
||
groupId=$(cat groupId.mvnhelp) | ||
artifactId=$(cat artifactId.mvnhelp) | ||
version=$(cat version.mvnhelp) | ||
artifact_path="${groupId//./\/}/${artifactId//./\/}/${version}/" | ||
prefix_name="${artifactId}-${version}" | ||
prefix_path="${artifact_path}/${prefix_name}" | ||
|
||
rm *.mvnhelp | ||
|
||
# Run Maven | ||
|
||
mvn clean install | ||
|
||
VERSION="0.0.2" | ||
REPOSITORY_PATH="com/yelloowstone/nf2t/nf2t-cli/$VERSION/" | ||
POM_TARGET_PATH="./target/nf2t-cli-0.0.2.pom" | ||
|
||
mkdir --parents "$REPOSITORY_PATH" | ||
rm -f "$REPOSITORY_PATH*" | ||
|
||
generate_file() { | ||
echo "$1" | ||
gpg --yes --local-user 0xCED254CF741FE1663B9BEC32D12C9545C6D5AA73 -ab $1 | ||
md5sum $1 | cut -d ' ' -f 1 > "$1.md5" | ||
sha1sum $1 | cut -d ' ' -f 1 > "$1.sha1" | ||
sha256sum $1 | cut -d ' ' -f 1 > "$1.sha256" | ||
sha512sum $1 | cut -d ' ' -f 1 > "$1.sha512" | ||
|
||
cp "$1" "./${REPOSITORY_PATH}" | ||
cp "$1.md5" "./${REPOSITORY_PATH}" | ||
cp "$1.sha1" "./${REPOSITORY_PATH}" | ||
cp "$1.sha256" "./${REPOSITORY_PATH}" | ||
cp "$1.asc" "./${REPOSITORY_PATH}" | ||
} | ||
|
||
for file in ./target/*.jar; do | ||
generate_file $file | ||
done | ||
# Create Maven Central ZIP Folder Structure | ||
|
||
cp "pom.xml" "$POM_TARGET_PATH" | ||
mkdir --parents "$artifact_path" | ||
|
||
generate_file "$POM_TARGET_PATH" | ||
artifact_root_path=$(echo "${artifact_path}" | cut -d '/' -f 1) | ||
|
||
# Check if the variable is less than 3 | ||
if [ "$artifact_root_path" -lt 3 ]; then | ||
echo "Error: Could not delete ${artifact_root_path}" | ||
exit 1 | ||
fi | ||
|
||
rm -rf "$artifact_root_path" | ||
mkdir --parents "$artifact_path" | ||
|
||
mvn help:effective-pom "-Doutput=${prefix_path}.pom" | ||
cp "./target/${prefix_name}-javadoc.jar" "$artifact_path" | ||
cp "./target/${prefix_name}-sources.jar" "$artifact_path" | ||
cp "./target/${prefix_name}.jar" "$artifact_path" | ||
|
||
# Create Maven Central ZIP file | ||
|
||
for file in "$artifact_path"/*; do | ||
echo "$file" | ||
gpg --yes --local-user $GPG_USER -ab $file | ||
md5sum $file | cut -d ' ' -f 1 > "$file.md5" | ||
sha1sum $file | cut -d ' ' -f 1 > "$file.sha1" | ||
sha256sum $file | cut -d ' ' -f 1 > "$file.sha256" | ||
sha512sum $file | cut -d ' ' -f 1 > "$file.sha512" | ||
done | ||
|
||
rm -f ./maven.zip | ||
zip -r ./maven.zip "$artifact_path" | ||
|
||
zip -r ./maven.zip "$REPOSITORY_PATH" | ||
rm -rf "$REPOSITORY_PATH" | ||
echo "${groupId}.${artifactId}.${version}/" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package com.yelloowstone.nf2t.cli; | ||
|
||
public enum Action { | ||
PACKAGE, UNPACKAGE; | ||
PACKAGE, UNPACKAGE, SCHEMA; | ||
} |
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 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
mvn versions:set -DnewVersion=0.0.2 | ||
mvn versions:set -DnewVersion=0.0.3 | ||
mvn versions:commit |