Skip to content

Commit

Permalink
jdk21
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed May 27, 2024
1 parent 95f1396 commit 30b6de3
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 17
java-version: 21

- uses: Ortus-Solutions/commandbox-action@v1.0.2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
env:
MODULE_ID: boxlang-miniserver
SNAPSHOT: ${{ inputs.snapshot || false }}
JDK: 17
JDK: 21
GRADLE: 8.7
BUILD_ID: ${{ github.run_number }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 17
java-version: 21

- name: Format Java Source
run: ./gradlew spotlessApply --stacktrace
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
fail-fast: false
matrix:
os: [ "ubuntu-latest", "windows-latest" ]
jdkVersion: [ "17" ]
jdkVersion: [ "21" ]
experimental: [false]
#include:
#- jdkVersion: "17"
#- jdkVersion: "21"
# os: "windows-latest"
# experimental: true
# Disabled for now until we can figure out the gradle matrix
#- jdkVersion: "17"
#- jdkVersion: "21"
# os: "ubuntu-latest"
# experimental: true
steps:
Expand Down
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ plugins {
id "com.diffplug.spotless" version "6.25.0"
// https://github.com/harbby/gradle-serviceloader
id "com.github.harbby.gradle.serviceloader" version "1.1.8"
// https://github.com/johnrengelman/shadow
id 'com.github.johnrengelman.shadow' version '8.1.1'
// For building shadow jars with jdk 17 ONLY
//id 'com.github.johnrengelman.shadow' version '8.1.1'
// For building shadow jars using JDK 21 +, they had to fork
id "io.github.goooler.shadow" version "8.1.7"
// Download task
id "de.undercouch.download" version "5.6.0"
// Task visualizer
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
version=1.0.0
group=ortus.boxlang
boxlangVersion=1.0.0
jdkVersion=17
jdkVersion=21
22 changes: 11 additions & 11 deletions src/main/java/ortus/boxlang/web/MiniServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static void main( String[] args ) {
if ( !absWebRoot.isAbsolute() ) {
absWebRoot = Paths.get( "" ).resolve( webRoot ).normalize().toAbsolutePath().normalize();
}
// Verify webroot exists on disk
// Verify webroot exists on disk, else fail
if ( !absWebRoot.toFile().exists() ) {
System.out.println( "Web Root does not exist, cannot continue: " + absWebRoot.toString() );
System.exit( 1 );
Expand Down Expand Up @@ -124,16 +124,16 @@ public static void main( String[] args ) {
.addHttpListener( port, host )
.setHandler( new EncodingHandler( new ContentEncodingRepository().addEncodingHandler(
"gzip", new GzipEncodingProvider(), 50, Predicates.parse( "request-larger-than(1500)" ) ) )
.setNext( new WelcomeFileHandler(
Handlers.predicate(
// If this predicate evaluates to true, we process via BoxLang, otherwise, we serve a static file
Predicates.parse( "regex( '^(/.+?\\.cfml|/.+?\\.cf[cms]|.+?\\.bx[ms]{0,1})(/.*)?$' )" ),
new BLHandler( absWebRoot.toString() ),
new ResourceHandler( resourceManager )
.setDirectoryListingEnabled( true ) ),
resourceManager,
List.of( "index.bxm", "index.bxs", "index.cfm", "index.cfs", "index.htm", "index.html" )
) ) )
.setNext( new WelcomeFileHandler(
Handlers.predicate(
// If this predicate evaluates to true, we process via BoxLang, otherwise, we serve a static file
Predicates.parse( "regex( '^(/.+?\\.cfml|/.+?\\.cf[cms]|.+?\\.bx[ms]{0,1})(/.*)?$' )" ),
new BLHandler( absWebRoot.toString() ),
new ResourceHandler( resourceManager )
.setDirectoryListingEnabled( true ) ),
resourceManager,
List.of( "index.bxm", "index.bxs", "index.cfm", "index.cfs", "index.htm", "index.html" )
) ) )
.build();

// Add a shutdown hook to stop the server
Expand Down

0 comments on commit 30b6de3

Please sign in to comment.