Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Gradle Wrapper #320

Merged
merged 1 commit into from
Nov 16, 2023
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
17 changes: 9 additions & 8 deletions .github/workflows/microshed-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,20 @@ jobs:
max-parallel: 18
matrix:
include:
- category: JAXRS
projects: >
jaxrs-json
jaxrs-basicauth
jaxrs-mpjwt
everything-app
- category: GENERAL
projects: >
maven-app
everything-app
everything-jakarta-app
jdbc-app
kafka-app
- category: COMPLEX
projects: >
everything-app
everything-jakarta-app
- category: RESTFUL
projects: >
jaxrs-json
jaxrs-basicauth
jaxrs-mpjwt
- category: LIBERTY/PAYARA
projects: >
liberty-app
Expand Down
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ ext.lastRelease = '0.9.1'

subprojects {
apply plugin: 'java'
apply plugin: 'java-library'

// java-library will force inter-project dependencies to use class files instead of jars
// This system property disables that and goes back to using jars
System.setProperty("org.gradle.java.compile-classpath-packaging", "true");

ext.publishScript = rootProject.rootDir.absolutePath + '/publish.gradle'

Expand Down
7 changes: 5 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@ ext.title = "MicroShed Testing Framework"
description="A test framework for black-box testing MicroProfile and Java EE applications"

dependencies {
compile 'org.junit.jupiter:junit-jupiter-api:5.10.1'
//API for artifact and unit testing
api 'org.junit.jupiter:junit-jupiter-api:5.10.1'

//Java EE
implementation 'org.eclipse:yasson:1.0.11'
implementation 'org.glassfish:javax.json:1.1.4'

//Support Libraries
implementation 'cglib:cglib-nodep:3.3.0'
implementation 'org.apache.cxf:cxf-rt-rs-client:3.6.2'
implementation 'org.apache.cxf:cxf-rt-rs-extension-providers:3.6.2'
implementation 'org.bitbucket.b_c:jose4j:0.7.2'

//Unit testing
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
}


apply from: publishScript
79 changes: 48 additions & 31 deletions core/jakarta/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,78 @@ ext.title = "MicroShed Testing Framework"
description="A test framework for black-box testing MicroProfile and Jakarta EE applications"

configurations {
transformer
parent {extendsFrom compile}
transformer {extendsFrom implementation}
}

dependencies {
compile 'org.junit.jupiter:junit-jupiter-api:5.10.1'
//API for artifact and unit testing
api 'org.junit.jupiter:junit-jupiter-api:5.10.1'

//Jakarta EE
implementation 'org.eclipse:yasson:2.0.4'
implementation 'org.eclipse.parsson:parsson:1.0.5'

//Support Libraries
implementation 'cglib:cglib-nodep:3.3.0'
implementation 'org.apache.cxf:cxf-rt-rs-client:4.0.3'
implementation 'org.apache.cxf:cxf-rt-rs-extension-providers:4.0.3'
implementation 'org.bitbucket.b_c:jose4j:0.7.2'

//Unit testing
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'

//Transform microshed-testing-core -> microshed-testing-core-jakarta
transformer 'org.eclipse.transformer:org.eclipse.transformer.cli:0.5.0'

parent project(':microshed-testing-core')
}

ext.parent_jar = configurations.parent.find{
it.name.startsWith("microshed-testing-core")
}
ext.transformed_jar = new File(projectDir, 'build/tmp/transformed/' + parent_jar.getName().replace('core', 'core-jakarta'))
jar {
mustRunAfter project(':microshed-testing-core').tasks.jar
mustRunAfter project(':microshed-testing-core').tasks.javadocJar
mustRunAfter project(':microshed-testing-core').tasks.sourcesJar

//Deletes previously transformed jar otherwise transformer will produce an error
task cleanupTransform() {
if(transformed_jar.exists()) {
transformed_jar.delete()
}
}
dependsOn project(':microshed-testing-core').tasks.jar
dependsOn project(':microshed-testing-core').tasks.javadocJar
dependsOn project(':microshed-testing-core').tasks.sourcesJar

//Creates the transformed archive in the build/tmp/transformed/ directory
task transform(type: JavaExec) {
dependsOn cleanupTransform
classpath = configurations.transformer
main = 'org.eclipse.transformer.cli.JakartaTransformerCLI'
args parent_jar, transformed_jar
}
def baseDir = project(':microshed-testing-core').buildDir
def baseJars = fileTree(baseDir).matching {include 'libs/*.jar' }

//Creates an empty jar file in the build/libs directory
//since there are no source files
jar.dependsOn transform
inputs.files(baseJars).skipWhenEmpty()
outputs.dir project.buildDir

//Overwrites the empty jar with the transformed jar in the build/libs directory
task overwrite(type: Copy) {
from(transformed_jar)
into('build/libs')
}
doLast {
new File(project.buildDir, "libs").mkdirs()
fileTree(project.buildDir).matching { include 'libs/*.jar' }.each { delete it }

baseJars.each { bundleJar ->
def sourceJar = baseDir.path + '/libs/' + bundleJar.name
println 'Source jar name [ ' + sourceJar + ' ]'

def transformedJar = project.buildDir.path + '/libs/' + bundleJar.name.replaceAll( 'microshed-testing-core', 'microshed-testing-core-jakarta' )
println 'Transformed jar name [ ' + transformedJar + ' ]'

jar.finalizedBy overwrite
def transformerArgs = [sourceJar, transformedJar]

javaexec {
classpath configurations.transformer
main = 'org.eclipse.transformer.cli.JakartaTransformerCLI'
args = transformerArgs
}
}
}
}

apply from: publishScript

javadocJar {
mustRunAfter jar
dependsOn jar
}

sourcesJar {
mustRunAfter jar
dependsOn jar
}

publishToMavenLocal.dependsOn ':microshed-testing-core:publishToMavenLocal'

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
51 changes: 31 additions & 20 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down Expand Up @@ -109,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
Expand Down Expand Up @@ -138,19 +154,19 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

Expand All @@ -159,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
Loading