Skip to content

Commit 5b35d5f

Browse files
committed
Release v1.1.0: Enhanced features and Java 11 compatibility
- Added dry-run mode (--dry-run, -n) for previewing operations - Updated Java compatibility from 8 to 11 with modern build config - Fixed Mercurial references, now using Git for version info - Enhanced debug mode with detailed logging - Improved build system with --release flag - Updated NetBeans project configuration - Fixed compiler warnings and version display - Comprehensive changelog updates
1 parent 1625c6e commit 5b35d5f

File tree

5 files changed

+132
-16
lines changed

5 files changed

+132
-16
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.0] - 2025-07-25
9+
10+
### Added
11+
- **Dry-run mode** (`--dry-run`, `-n`) for previewing what will be processed
12+
- Java 11 compatibility with modern build configuration
13+
- Git integration for version information (replaces Mercurial)
14+
- Enhanced debug mode with detailed logging capabilities
15+
- JSON output format for programmatic consumption
16+
17+
### Changed
18+
- Updated Java source level from 8 to 11 for better compatibility
19+
- Improved build system with `--release` flag instead of deprecated `-source`
20+
- Enhanced error handling and user feedback
21+
- Updated NetBeans project configuration for Java 11
22+
23+
### Fixed
24+
- Mercurial references in build scripts (now uses Git)
25+
- Compiler warnings related to Java version configuration
26+
- Version information now properly displays Git commit ID
27+
- Build system compatibility with modern Java toolchains
28+
29+
### Technical Debt
30+
- Some test failures due to missing resources (non-critical)
31+
- Minor unchecked operations warning in ProjectScanner.java
32+
833
## [1.0.0] - 2025-01-25
934

1035
### Added
@@ -82,6 +107,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
82107

83108
- **0.1-alpha**: Initial release with core functionality
84109
- **1.0.0**: Modernization and community improvements
110+
- **1.1.0**: Enhanced features and Java 11 compatibility
85111
- **Unreleased**: Future enhancements and features
86112

87113
## Migration Guide

README.md

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,60 @@ This tool is particularly useful when:
4444

4545
Get up and running in 5 minutes:
4646

47+
### 1. Prerequisites
48+
- Java 8 or later installed
49+
- Git (for cloning the repository)
50+
51+
### 2. Installation
4752
```bash
4853
# Clone the repository
4954
git clone https://github.com/cm45t3r/jpf-autodoc-types.git
5055
cd jpf-autodoc-types
5156

52-
# Build the project
57+
# Build the project (no external dependencies required)
5358
./bin/ant build
59+
```
5460

55-
# Run on a JPF project
61+
### 3. Basic Usage
62+
```bash
63+
# Analyze a JPF project (if registered in site.properties)
5664
./bin/jpfadt jpf-core
5765

58-
# Or analyze a specific directory
66+
# Analyze a specific directory
5967
./bin/jpfadt /path/to/your/jpf/project/build
68+
69+
# Analyze with verbose output
70+
./bin/jpfadt -v /path/to/your/project
71+
72+
# Generate multiple output formats
73+
./bin/jpfadt --output-all /path/to/your/project
74+
```
75+
76+
### 4. Output Formats
77+
The tool generates documentation in multiple formats:
78+
- **XML** (default): `jpf-types.xml`
79+
- **JSON**: `jpf-types.json` (for programmatic consumption)
80+
- **Markdown**: `jpf-types.md`
81+
- **Text**: `jpf-types.txt`
82+
- **Wiki**: `jpf-types.wiki`
83+
84+
### 5. Example Output
85+
```bash
86+
# Run the tool
87+
./bin/jpfadt /path/to/jpf-core/build
88+
89+
# Check the generated files
90+
ls -la jpf-types.*
91+
```
92+
93+
### 6. Troubleshooting
94+
If you encounter issues:
95+
```bash
96+
# Enable debug mode for detailed information
97+
./bin/jpfadt --debug debug.log /path/to/your/project
98+
99+
# Check the error summary at the end of execution
100+
# The tool will show skipped files and error details
60101
```
61102

62103
Navigate to root folder in order to build, run and execute tests:

build.xml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
<!-- ========================== COMMON SECTION ========================== -->
1818

1919
<!-- compiler settings -->
20-
<property name="src_level" value="8"/>
20+
<property name="src_level" value="11"/>
2121
<property name="debug" value="on"/>
2222
<property name="deprecation" value="on"/>
23+
<property name="release_level" value="11"/>
2324

2425
<uptodate property="build_uptodate" targetfile="build.properties" srcfile="build.properties"/>
2526

@@ -69,28 +70,28 @@
6970
<target name="-compile-annotations" if="have_annotations">
7071
<mkdir dir="build/annotations"/>
7172
<javac srcdir="src/annotations" destdir="build/annotations" includeantruntime="false"
72-
debug="${debug}" source="${src_level}" deprecation="${deprecation}" classpath=""/>
73+
debug="${debug}" release="${release_level}" deprecation="${deprecation}" classpath=""/>
7374
</target>
7475

7576
<target name="-compile-main" if="have_main">
7677
<mkdir dir="build/main"/>
7778
<javac srcdir="src/main" destdir="build/main" includeantruntime="false"
78-
debug="${debug}" source="${src_level}" deprecation="${deprecation}"
79+
debug="${debug}" release="${release_level}" deprecation="${deprecation}"
7980
classpathref="lib.path"/>
8081

8182
</target>
8283

8384
<target name="-compile-peers" if="have_peers" depends="-compile-main" >
8485
<mkdir dir="build/peers"/>
8586
<javac srcdir="src/peers" destdir="build/peers" includeantruntime="false"
86-
debug="${debug}" source="${src_level}" deprecation="${deprecation}"
87+
debug="${debug}" release="${release_level}" deprecation="${deprecation}"
8788
classpathref="lib.path"/>
8889
</target>
8990

9091
<target name="-compile-classes" if="have_classes" depends="-compile-annotations,-compile-main" >
9192
<mkdir dir="build/classes"/>
9293
<javac srcdir="src/classes" destdir="build/classes" includeantruntime="false"
93-
debug="${debug}" source="${src_level}" deprecation="${deprecation}">
94+
debug="${debug}" release="${release_level}" deprecation="${deprecation}">
9495
<classpath>
9596
<path refid="lib.path"/>
9697
<pathelement location="build/annotations"/>
@@ -101,7 +102,7 @@
101102
<target name="-compile-tests" if="have_tests" depends="-compile-annotations,-compile-main">
102103
<mkdir dir="build/tests"/>
103104
<javac srcdir="src/tests" destdir="build/tests" includeantruntime="false"
104-
debug="${debug}" source="${src_level}" deprecation="${deprecation}"
105+
debug="${debug}" release="${release_level}" deprecation="${deprecation}"
105106
includes="*,gov/nasa/jpf/**">
106107
<classpath>
107108
<path refid="lib.path"/>
@@ -113,7 +114,7 @@
113114
<target name="-compile-examples" if="have_examples" depends="-compile-annotations,-compile-main">
114115
<mkdir dir="build/examples" />
115116
<javac srcdir="src/examples" destdir="build/examples" includeantruntime="false"
116-
debug="${debug}" source="${src_level}" deprecation="${deprecation}"
117+
debug="${debug}" release="${release_level}" deprecation="${deprecation}"
117118
classpathref="lib.path"/>
118119
</target>
119120

@@ -124,7 +125,7 @@
124125
<property name="system.name" value="JPF autodoc types"/>
125126
<property name="system.vendor" value="FLA/NASA Ames Research Center"/>
126127
<property name="system.release" value="stable"/>
127-
<property name="major.version" value="1.0"/>
128+
<property name="major.version" value="1.1.0"/>
128129

129130
<!-- include all lib/*.jar for classpath -->
130131
<path id="lib.classpath">
@@ -288,7 +289,7 @@
288289
</not>
289290
</condition>
290291

291-
<junit printsummary="on" showoutput="off" haltonfailure="no" dir="${basedir}"
292+
<junit printsummary="on" showoutput="on" haltonfailure="no" dir="${basedir}"
292293
fork="yes" forkmode="perTest" maxmemory="1024m" outputtoformatters="true">
293294
<formatter type="plain" usefile="${junit.usefile}"/>
294295

nbproject/project.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@
118118
<compilation-unit>
119119
<package-root>src/main</package-root>
120120
<classpath mode="compile">lib/jpf.jar;lib/castor-1.3.2.jar;lib/castor-1.3.2-core.jar;lib/castor-1.3.2-xml.jar;lib/commons-lang-2.1.jar;lib/commons-logging-1.1.1.jar</classpath>
121-
<source-level>1.6</source-level>
121+
<source-level>11</source-level>
122122
</compilation-unit>
123123
<compilation-unit>
124124
<package-root>src/tests</package-root>
125125
<unit-tests/>
126126
<classpath mode="compile">build/jpf-autodoc-types.jar;lib/jpf.jar;lib/junit-4.9.jar;lib/xmlunit-1.3.jar</classpath>
127-
<source-level>1.6</source-level>
127+
<source-level>11</source-level>
128128
</compilation-unit>
129129
</java-data>
130130
<preferences xmlns="http://www.netbeans.org/ns/auxiliary-configuration-preferences/1">

src/main/gov/nasa/jpf/autodoc/types/AutoDocTool.java

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ public enum Options {
115115
/** Enable automated scan output integrity check. */
116116
CHECK_DSCAN (0x400000, true, "-cS,-check-scan,--check-scan"),
117117
/** Enable automated xml integrity check. */
118-
CHECK_DXML (0x800000, true, "-cX,-check-xml,--check-xml");
118+
CHECK_DXML (0x800000, true, "-cX,-check-xml,--check-xml"),
119+
/** Enable dry-run mode to preview what will be processed. */
120+
DRY_RUN (0x1000000, false, "-n,--dry-run");
119121

120122
private final int weight;
121123
private final boolean hasParam;
@@ -470,6 +472,22 @@ protected static void startScan(int options)
470472

471473
int opts = (options & 0xF0) >> 0x4;
472474

475+
if (isOptionEnabled(options, Options.DRY_RUN.weight)) {
476+
// Dry-run mode: just show what would be scanned
477+
System.out.println("=== DRY RUN MODE ===");
478+
System.out.println("Targets to scan:");
479+
for (String target : targets) {
480+
System.out.println(" - " + target);
481+
}
482+
System.out.println("Classpath:");
483+
for (String cp : classpath) {
484+
System.out.println(" - " + cp);
485+
}
486+
System.out.println("Scan type: " + scanner.getScanType(opts));
487+
System.out.println("=== END DRY RUN ===");
488+
return;
489+
}
490+
473491
scanner.scan(targets, classpath, scanner.getScanType(opts));
474492
info.storeParsed(scanner.getScanned());
475493
}
@@ -482,6 +500,19 @@ protected static void startScan(int options)
482500
*/
483501
protected static void startAnalyses(int options)
484502
throws ClassFileNotFoundException {
503+
if (isOptionEnabled(options, Options.DRY_RUN.weight)) {
504+
// Dry-run mode: just show what would be analyzed
505+
System.out.println("=== DRY RUN MODE - ANALYSIS ===");
506+
System.out.println("Analysis options:");
507+
int opts = options & 0xF;
508+
if ((opts & 0x1) != 0) System.out.println(" - Listeners");
509+
if ((opts & 0x2) != 0) System.out.println(" - Instruction Factories");
510+
if ((opts & 0x4) != 0) System.out.println(" - Model Classes");
511+
if ((opts & 0x8) != 0) System.out.println(" - Native Peer Classes");
512+
System.out.println("=== END DRY RUN ===");
513+
return;
514+
}
515+
485516
trigger.addModelPath(System.getProperty("sun.boot.class.path"));
486517

487518
trigger.addTypePaths(config.getPropertyVals(
@@ -522,6 +553,22 @@ public boolean accept(File dir, String name) {
522553
public static void checkOutputOpts(String[] args, int options)
523554
throws IOException, MappingException, MarshalException,
524555
ValidationException {
556+
// Handle dry-run mode for output
557+
if (isOptionEnabled(options, Options.DRY_RUN.weight)) {
558+
System.out.println("=== DRY RUN MODE - OUTPUT ===");
559+
System.out.println("Output options:");
560+
if (isOptionEnabled(options, Options.OUT_LEVEL1.weight)) System.out.println(" - Verbosity Level 1");
561+
if (isOptionEnabled(options, Options.OUT_LEVEL2.weight)) System.out.println(" - Verbosity Level 2");
562+
if (isOptionEnabled(options, Options.TEXTFILE.weight)) System.out.println(" - Text file output");
563+
if (isOptionEnabled(options, Options.XML.weight)) System.out.println(" - XML file output");
564+
if (isOptionEnabled(options, Options.WIKI.weight)) System.out.println(" - Wiki file output");
565+
if (isOptionEnabled(options, Options.MARKDOWN.weight)) System.out.println(" - Markdown file output");
566+
if (isOptionEnabled(options, Options.JSON.weight)) System.out.println(" - JSON file output");
567+
if (isOptionEnabled(options, Options.OUTPUT_ALL.weight)) System.out.println(" - All output formats");
568+
System.out.println("=== END DRY RUN ===");
569+
return;
570+
}
571+
525572
String debug = new String();
526573
String debugFile = new String();
527574

@@ -919,6 +966,7 @@ public static void showUsage() {
919966
console.writeln(" -d | -debug | --debug [<file>] : enable debug mode with "
920967
+ "detailed logging. | ");
921968
console.writeln(" -dS | -debug-scan | --debug-scan [<file>] : enable debug "
922-
+ "mode for scan operations.");
969+
+ "mode for scan operations. | ");
970+
console.writeln(" -n | --dry-run : enable dry-run mode to preview what will be processed.");
923971
}
924972
}

0 commit comments

Comments
 (0)