Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ cd PerlOnJava

# Build and run tests
make # Build + run all unit tests
make dev # Build only, skip tests (for quick iteration during debugging)

# Run comprehensive tests
make test-all
Expand Down Expand Up @@ -103,9 +102,6 @@ perl5_t/ (at project root)
# Build + run all unit tests (default)
make

# Build only, skip tests (for quick iteration during debugging)
make dev

# Run all tests including Perl 5 core tests
make test-all

Expand Down
73 changes: 63 additions & 10 deletions Configure.pl
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# PerlOnJava Configuration Script
#
# This script manages configuration settings and dependencies for the PerlOnJava project.
# It updates Configuration.java (the single source of truth for version info) and
# It updates Configuration.java.in (the single source of truth for version info) and
# propagates version changes to all relevant files in the repository.
#
# USAGE:
#
# ./Configure.pl # Show current configuration
# ./Configure.pl -D version=5.43.0 # Update version everywhere
# ./Configure.pl -D version=5.44.0 # Update version everywhere
# ./Configure.pl --upgrade # Upgrade dependencies to latest versions
#
# VERSION UPDATE BEHAVIOR:
Expand Down Expand Up @@ -50,7 +50,7 @@
my %config; # Hash to store key-value pairs for configuration updates
my $help = 0; # Flag to show help message

my $java_config_filename = 'src/main/java/org/perlonjava/core/Configuration.java';
my $java_config_filename = 'src/main/java/org/perlonjava/core/Configuration.java.in';

# Parse command-line options
Getopt::Long::Configure("no_ignore_case");
Expand Down Expand Up @@ -88,8 +88,8 @@ sub show_help {
-D key=value Set configuration value

Supported configuration keys:
version - PerlOnJava version (e.g., 5.43.0)
Updates Configuration.java, build files, and all JAR references
version - PerlOnJava version (e.g., 5.44.0)
Updates Configuration.java.in, build files, and all JAR references

Read-only keys (managed by build system):
gitCommitId - Git commit hash (set during build)
Expand All @@ -103,7 +103,7 @@ sub show_help {

Examples:
./Configure.pl # Show current configuration
./Configure.pl -D version=5.43.0 # Update version everywhere
./Configure.pl -D version=5.44.0 # Update version everywhere
./Configure.pl --search org.h2.Driver # Search for JDBC driver
./Configure.pl --direct com.h2database:h2:2.2.224
./Configure.pl --upgrade # Upgrade all dependencies
Expand Down Expand Up @@ -170,9 +170,31 @@ sub update_configuration {
}

write_file($file, $content);
sync_generated_configuration($config);
print "\nConfiguration updated successfully\n";
}

# Keep an existing local generated file in sync with the tracked template.
# The build recreates this file on a fresh checkout, but developers commonly
# retain it between builds.
sub sync_generated_configuration {
my ($config) = @_;
(my $generated_file = $java_config_filename) =~ s/\.in$//;
return if $generated_file eq $java_config_filename || !-f $generated_file;

my $content = read_file($generated_file);
my $updated = 0;
for my $key (keys %$config) {
next if $key eq 'gitCommitId' || $key eq 'gitCommitDate';
my $value = $config->{$key};
my $quoted_value = $value =~ /^(?:true|false|\d+)$/ ? $value : qq{"$value"};
$updated = 1
if $content =~ s/(public static final \w+\s+\Q$key\E\s*=\s*)("[^"]*"|[^;]+);/${1}$quoted_value;/;
}

write_file($generated_file, $content) if $updated;
}

# Function to validate version changes before applying them
sub validate_version_change {
my ($old_version, $new_version) = @_;
Expand Down Expand Up @@ -206,6 +228,7 @@ sub update_version_everywhere {
my @excluded_dirs = (
'./src/main/perl', # Perl modules with historical version docs
'./dev', # Design documents and development notes
'./perl5', # Nested upstream Perl checkout
);

# Files to exclude from version updates (relative to project root)
Expand All @@ -217,7 +240,7 @@ sub update_version_everywhere {
# First pass: Update JAR filename references in ALL files (always safe)
# This includes: jperl, jperl.bat, docs, examples, src/main/perl comments, etc.
# Matches both perlonjava-X.Y.Z.jar and perlonjava-X.Y.Z-all.jar
my @all_files = `find . -type f -not -path "*/\\.*" -not -path "*/build/*" -not -path "*/target/*"`;
my @all_files = `find . -type f -not -path "*/\\.*" -not -path "*/build/*" -not -path "*/target/*" -not -path "./perl5/*"`;
foreach my $file (@all_files) {
chomp $file;
next if -B $file; # Skip binary files
Expand Down Expand Up @@ -246,7 +269,7 @@ sub update_version_everywhere {
my $updated = 0;

# Update version in build.gradle (project version only)
if ($file =~ /build\.gradle$/ && $file_content =~ s/^(version\s*=\s*')$old_version(')\s*$/$1$new_version$2/m) {
if ($file =~ /build\.gradle$/ && $file_content =~ s/^(version\s*=\s*')$old_version(')[ \t]*$/$1$new_version$2/m) {
$updated = 1;
print "Updated version in $file\n";
}
Expand All @@ -262,7 +285,9 @@ sub update_version_everywhere {

# Update version in README.md (feature support line)
if ($file =~ /README\.md$/) {
if ($file_content =~ s/(Supports most Perl )$old_version( features)/$1$new_version$2/g) {
(my $old_feature_version = $old_version) =~ s/\.0$//;
(my $new_feature_version = $new_version) =~ s/\.0$//;
if ($file_content =~ s/(Perl )\Q$old_feature_version\E( language compatibility)/$1$new_feature_version$2/g) {
$updated = 1;
print "Updated version in $file\n";
}
Expand Down Expand Up @@ -316,7 +341,7 @@ sub update_config_pm {
$updated = 1;
}

# Pattern: path components like /5.42.0/
# Pattern: path components like /X.Y.Z/
if ($content =~ s|(/perl5/)$old_version(/)|$1$new_version$2|g) {
$updated = 1;
}
Expand All @@ -326,6 +351,34 @@ sub update_config_pm {
if ($content =~ s|(/vendor_perl/)$old_version(/)|$1$new_version$2|g) {
$updated = 1;
}

# Config.pm also contains versioned paths assembled from quoted components
# and paths whose version is immediately followed by a quote.
if ($content =~ s|('perl5',\s*')$old_version(')|$1$new_version$2|g) {
$updated = 1;
}
if ($content =~ s{((?:site|vendor)_perl/)\Q$old_version\E(?=['/])}{$1$new_version}g) {
$updated = 1;
}

my ($new_major, $new_minor, $new_patch) = split /\./, $new_version;
$new_patch //= 0;
my $new_decimal_version = sprintf '%d.%03d%03d', $new_major, $new_minor, $new_patch;
if ($content =~ s/(\$VERSION\s*=\s*")\d+\.\d+(")/$1$new_decimal_version$2/) {
$updated = 1;
}
if ($content =~ s/(version_patchlevel_string\s*=>\s*'version\s+)\d+(\s+patchlevel\s+)\d+(')/$1$new_minor$2$new_patch$3/) {
$updated = 1;
}
if ($content =~ s/(api_version\s*=>\s*')\d+(')/$1$new_minor$2/) {
$updated = 1;
}
if ($content =~ s/(api_subversion\s*=>\s*')\d+(')/$1$new_patch$2/) {
$updated = 1;
}
if ($content =~ s/(revision\s+)\d+(\s+version\s+)\d+(\s+subversion\s+)\d+/$1$new_major$2$new_minor$3$new_patch/) {
$updated = 1;
}

if ($updated) {
write_file($config_pm, $content);
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ FROM eclipse-temurin:22-jdk
WORKDIR /app

# Copy the built JAR file from the Maven container
COPY --from=build /app/target/perlonjava-5.42.0.jar /app/perlonjava-5.42.0.jar
COPY --from=build /app/target/perlonjava-5.44.0.jar /app/perlonjava-5.44.0.jar

# Copy the wrapper scripts
COPY --from=build /app/jperl /app/jperl
Expand Down
5 changes: 3 additions & 2 deletions QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cd PerlOnJava
make
```

The `make` command builds the project and runs all unit tests. The complete build with tests typically completes in ~30 seconds.
The `make` command builds the runnable JAR and runs the fast unit test suite.

**Build troubleshooting:**

Expand All @@ -67,7 +67,8 @@ make clean
make
```

The project uses Gradle 9.0+ (configured in the wrapper) which supports Java 22-25+.
Use the Gradle version configured in `gradle/wrapper/gradle-wrapper.properties`;
the checked-in wrapper is kept aligned with the project's JDK requirement.
</details>

For more troubleshooting: See [Installation Guide](docs/getting-started/installation.md#troubleshooting)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PerlOnJava compiles Perl to JVM bytecode — run existing Perl scripts on any pl
- **Install more with jcpan** — [pure-Perl CPAN modules](docs/guides/using-cpan-modules.md) work out of the box
- **JDBC database access** — [PostgreSQL, MySQL, SQLite, Oracle](docs/guides/database-access.md) via standard JDBC drivers
- **Embed in Java apps** — [JSR-223 ScriptEngine](docs/guides/java-integration.md) integration
- **Perl 5.42 language compatibility** — [see feature matrix](docs/reference/feature-matrix.md)
- **Perl 5.44 language compatibility** — [see feature matrix](docs/reference/feature-matrix.md)

## Quick Start

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ tasks.buildDeb {

// Project metadata
group = 'org.perlonjava'
version = '5.42.0'
version = '5.44.0'

// CycloneDX SBOM generation configuration
cyclonedxBom {
Expand Down
2 changes: 1 addition & 1 deletion dev/design/bytecode_debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,5 @@ Fix strategy:

## Notes

- `jperl` runs `target/perlonjava-5.42.0.jar`. Rebuild after changes, otherwise you may be debugging stale code.
- `jperl` runs `target/perlonjava-5.44.0.jar`. Rebuild after changes, otherwise you may be debugging stale code.
- `JPERL_ASM_DEBUG_CLASS` is useful to avoid massive logs during large tests.
2 changes: 1 addition & 1 deletion dev/design/debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This client would use JPDA to communicate with the JVM, but would present the de
## Run PerlOnJava with Debug Flags

```bash
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -jar target/perlonjava-5.42.0.jar myscript.pl
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -jar target/perlonjava-5.44.0.jar myscript.pl
```

## Start Debugging
Expand Down
12 changes: 6 additions & 6 deletions dev/design/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ This guide helps you start using PerlOnJava to run Perl code on the Java Virtual

1. Download the JAR file:
```bash
java -jar target/perlonjava-5.42.0.jar
java -jar target/perlonjava-5.44.0.jar
```

2. Run your first Perl script:
```bash
java -jar target/perlonjava-5.42.0.jar -E 'print "Hello from Perl on JVM!\n"'
java -jar target/perlonjava-5.44.0.jar -E 'print "Hello from Perl on JVM!\n"'
```

## Basic Usage Examples
Expand All @@ -22,12 +22,12 @@ java -jar target/perlonjava-5.42.0.jar -E 'print "Hello from Perl on JVM!\n"'

Run a Perl file:
```bash
java -jar target/perlonjava-5.42.0.jar script.pl
java -jar target/perlonjava-5.44.0.jar script.pl
```

Run Perl code directly:
```bash
java -jar target/perlonjava-5.42.0.jar -E 'for (1..3) { print "$_\n" }'
java -jar target/perlonjava-5.44.0.jar -E 'for (1..3) { print "$_\n" }'
```

### 2. Using Modules
Expand Down Expand Up @@ -90,12 +90,12 @@ Common switches:

Enable debugging output:
```bash
java -jar target/perlonjava-5.42.0.jar --debug script.pl
java -jar target/perlonjava-5.44.0.jar --debug script.pl
```

View generated bytecode:
```bash
java -jar target/perlonjava-5.42.0.jar --disassemble script.pl
java -jar target/perlonjava-5.44.0.jar --disassemble script.pl
```

## Next Steps
Expand Down
2 changes: 1 addition & 1 deletion dev/design/graalvm.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Added GraalVM support to pom.xml in a dedicated profile:
Used GraalVM tracing agent to capture required runtime methods:

```bash
java -agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image -jar target/perlonjava-5.42.0.jar examples/life.pl
java -agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image -jar target/perlonjava-5.44.0.jar examples/life.pl
```

## Results
Expand Down
12 changes: 6 additions & 6 deletions dev/design/maven-central-publishing.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Publishing to Maven Central provides:
|-------------|--------|
| GroupId (`org.perlonjava`) | ✅ Valid |
| ArtifactId (`perlonjava`) | ✅ Valid |
| Version (`5.42.0`) | ✅ Valid (not -SNAPSHOT) |
| Version (`5.44.0`) | ✅ Valid (not -SNAPSHOT) |
| POM `<name>` | ✅ Present |
| POM `<description>` | ❌ **Missing** |
| POM `<url>` | ⚠️ Placeholder (`http://maven.apache.org`) |
Expand Down Expand Up @@ -55,7 +55,7 @@ Reference: [Sonatype Requirements](https://central.sonatype.org/publish/requirem
<!-- Project coordinates (already present) -->
<groupId>org.perlonjava</groupId>
<artifactId>perlonjava</artifactId>
<version>5.42.0</version>
<version>5.44.0</version>
<packaging>jar</packaging>

<!-- Human-readable info (MISSING) -->
Expand Down Expand Up @@ -100,10 +100,10 @@ For each release, Maven Central requires:

| Artifact | Description |
|----------|-------------|
| `perlonjava-5.42.0.jar` | Main JAR (already built) |
| `perlonjava-5.42.0.pom` | POM file with metadata |
| `perlonjava-5.42.0-sources.jar` | Source code JAR |
| `perlonjava-5.42.0-javadoc.jar` | Javadoc JAR |
| `perlonjava-5.44.0.jar` | Main JAR (already built) |
| `perlonjava-5.44.0.pom` | POM file with metadata |
| `perlonjava-5.44.0-sources.jar` | Source code JAR |
| `perlonjava-5.44.0-javadoc.jar` | Javadoc JAR |
| `*.asc` | GPG signatures for all above |
| `*.md5`, `*.sha1` | Checksums for all above |

Expand Down
Loading
Loading