From 72205d40535e9d8d0fe67dec52a09998083d334c Mon Sep 17 00:00:00 2001 From: Amos Date: Sat, 17 Dec 2022 01:18:25 -0800 Subject: [PATCH] #4 Upgrade lib, Package with mvn --- BinaryInternalsViewer/pom.xml | 54 ++++++++++++++++++++++ BinaryInternalsViewer/src/assembly/bin.xml | 36 +++++++++++++++ README.md | 17 ++++--- build.sh | 17 +++---- pom.xml | 9 ++-- 5 files changed, 113 insertions(+), 20 deletions(-) create mode 100644 BinaryInternalsViewer/src/assembly/bin.xml diff --git a/BinaryInternalsViewer/pom.xml b/BinaryInternalsViewer/pom.xml index b0fae39..6c3c9c1 100644 --- a/BinaryInternalsViewer/pom.xml +++ b/BinaryInternalsViewer/pom.xml @@ -12,6 +12,10 @@ freeinternals :: BinaryInternalsViewer + + yyyyMMdd.HHmmss + + ${project.groupId} @@ -56,6 +60,8 @@ + ${project.artifactId}-${project.version}-${git.commit.id.abbrev}-${maven.build.timestamp} + @@ -94,6 +100,54 @@ + + + io.github.git-commit-id + git-commit-id-maven-plugin + ${git-commit-id-maven-plugin.version} + + + get-the-git-infos + + revision + + initialize + + + + true + ${project.build.outputDirectory}/git.properties + + ^git.build.(time|version)$ + ^git.commit.id.(abbrev|full)$ + + full + + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + ${maven-assembly-plugin.version} + + + src/assembly/bin.xml + + ${project.parent.basedir}${file.separator}dist + + + + package + + single + + + + + diff --git a/BinaryInternalsViewer/src/assembly/bin.xml b/BinaryInternalsViewer/src/assembly/bin.xml new file mode 100644 index 0000000..862a981 --- /dev/null +++ b/BinaryInternalsViewer/src/assembly/bin.xml @@ -0,0 +1,36 @@ + + bin + + tar.gz + zip + + + + ${project.basedir} + / + + README* + LICENSE* + NOTICE* + + + + ${project.build.directory} + / + + *.jar + + + + ${project.build.directory}/libs + libs + + *.jar + + + + + diff --git a/README.md b/README.md index 298cb89..59ae9a0 100644 --- a/README.md +++ b/README.md @@ -23,14 +23,11 @@ Download User guide * We need the `java` command to run this tool - * `java -jar BinaryInternalsViewer-3.5.jar` + * `java -jar BinaryInternalsViewer-3.5-gitcommitid.jar` + * Where `gitcommitid` is the auto-generated `git` commit id * Menu item: `File` > `Open...` * Choose the binary file to view -Dependency - -* This application do not rely on any 3rd party libraries other than JDK, easy to add it to your project - Build the Source Code * Prerequisite @@ -39,12 +36,18 @@ Build the Source Code * Set `JAVA_HOME` environment variable * If not set use the export statements in the `build.sh` script * Build scripts - * Linux/MacOS: `./build.sh` Do a quickly build, or `./full-lifecycle-build.sh` do a full build via execute all targets like checkstyle, spotbugs, etc. - * Windows: `build.cmd` + * Linux/MacOS/Windows Git Bash: + * `./build.sh` Do a quickly build, or + * `./full-lifecycle-build.sh` do a full build via execute all targets like checkstyle, spotbugs, etc. + * Windows CMD: `build.cmd` * Test Case for Java `.class` format * `./format-class-masstest.sh` Parse all `.class` files in Ubuntu linux system `default-java` folder * We can edit the `JAVA_FOLDER` variable in the script if want to test with other Java versions +Dependency + +* This application do not rely on 3rd party libraries other than JDK, easy to add it to your project + Legacy note * The original `Java Class Viewer` has been retired and merged into `Binary Internals Viewer` since Apr 2021 diff --git a/build.sh b/build.sh index c465211..93ad092 100755 --- a/build.sh +++ b/build.sh @@ -15,21 +15,18 @@ # Set java home on MacOS #JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.0.3.1.jdk/Contents/Home +# Set java home on Windows +# - Reference: https://www.theserverside.com/feature/How-to-set-JAVA_HOME-in-Windows-and-echo-the-result +# - Example value: JAVA_HOME=C:\data\tools\jdk + java -version +git log -1 --format='%H %aI' > BinaryInternalsViewer/VERSION.log + mvn clean package install mvn javadoc:aggregate mvn jdeps:jdkinternals mvn versions:display-dependency-updates -# Package -# Add git revision info to version.log -# Save to dist folder - -mkdir -p dist -cd BinaryInternalsViewer/target && pwd -git log -1 --format='%H %aI' > version.log -zip -r "../../dist/BinaryInternalsViewer-3.5_$(date '+%Y-%m-%d_%H.%M.%S').zip" BinaryInternalsViewer-3.5.jar libs/ version.log - echo "$0 Finished" - +LTS diff --git a/pom.xml b/pom.xml index 59b6260..44ddcca 100644 --- a/pom.xml +++ b/pom.xml @@ -41,10 +41,11 @@ 11 3.3.0 + 3.4.2 UTF-8 4.7.3 - 3.5 + 5.0.0 @@ -80,7 +81,7 @@ com.puppycrawl.tools checkstyle - 10.4 + 10.5.0 @@ -133,7 +134,7 @@ - + org.apache.maven.plugins maven-javadoc-plugin @@ -160,6 +161,8 @@ + + org.apache.maven.plugins maven-source-plugin