Skip to content

Commit

Permalink
Merge pull request #17 from IntershopCommunicationsAG/solvedebugissue
Browse files Browse the repository at this point in the history
Solve issue with Gradle debug option
  • Loading branch information
m-raab authored May 14, 2019
2 parents bee51f6 + 4803b86 commit a45e94c
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
= JAXB Gradle Plugin
:latestRevision: 3.0.1
:latestRevision: 3.0.3
:toc:
:icons: font

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ if (project.version.toString().endsWith("-SNAPSHOT")) {

tasks {
withType<Test>().configureEach {
systemProperty("intershop.gradle.versions", "5.3")
systemProperty("intershop.gradle.versions", "5.4.1")

if(project.hasProperty("repoURL") && project.hasProperty("repoUser") && project.hasProperty("repoPasswd")) {
systemProperty("repo_url_config", project.property("repoURL").toString())
Expand Down
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-5.3.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,10 @@ class SchemaToJavaTask extends DefaultTask {
if(! getStrictValidation()) {
arg(value: '-nv')
}
if (log.isDebugEnabled()) {
arg(value: '-debug')
}
if (log.isInfoEnabled()) {
if (log.isInfoEnabled() || log.isDebugEnabled()) {
arg(value: '-verbose')
} else {
arg(value: '-quiet')
}
}
log.info(' -> Unlocked XJC Gradle Task!')
Expand Down
83 changes: 83 additions & 0 deletions src/test/groovy/com/intershop/gradle/jaxb/SamplesSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,89 @@ class SamplesSpec extends AbstractIntegrationGroovySpec {
gradleVersion << supportedGradleVersions
}

def 'Test multithread execution - xjc with debug'() {
given:
copyResources('samples/catalog-resolver', 'test01')
copyResources('samples/create-marshal', 'test02')
copyResources('samples/external-customize', 'test03')
copyResources('samples/fix-collides', 'test04')
copyResources('samples/synchronized-methods', 'test05')

buildFile << """
plugins {
id 'java'
id 'com.intershop.gradle.jaxb'
}
jaxb {
javaGen {
test01 {
schema = file('test01/test.xsd')
catalog = file('test01/catalog.cat')
packageName = 'test01'
}
test02 {
packageName = 'primer.po'
schema = file('test02/po.xsd')
}
test03 {
binding = file('test03/binding.xjb')
schema = file('test03/po.xsd')
packageName = 'test03'
}
test04 {
binding = file('test04/binding.xjb')
schema = file('test04/example.xsd')
packageName = 'test04'
}
test05 {
schema = file('test05/po.xsd')
packageName = 'primer.test05.myPo'
extension = true
arg('-Xsync-methods')
}
}
}
repositories {
mavenCentral()
}
""".stripIndent()

when:
List<String> args = ['compileJava', '-s', '-d', '--configure-on-demand', '--parallel', '--max-workers=4']

def result = getPreparedGradleRunner()
.withArguments(args)
.withGradleVersion(gradleVersion)
.build()

then:
result.task(':jaxbJavaGenTest01').outcome == SUCCESS
result.task(':jaxbJavaGenTest02').outcome == SUCCESS
result.task(':jaxbJavaGenTest03').outcome == SUCCESS
result.task(':jaxbJavaGenTest04').outcome == SUCCESS
result.task(':jaxbJavaGenTest05').outcome == SUCCESS
result.task(':compileJava').outcome == SUCCESS

when:
def resultSec = getPreparedGradleRunner()
.withArguments(args)
.withGradleVersion(gradleVersion)
.build()

then:
resultSec.task(':jaxbJavaGenTest01').outcome == UP_TO_DATE
resultSec.task(':jaxbJavaGenTest02').outcome == UP_TO_DATE
resultSec.task(':jaxbJavaGenTest03').outcome == UP_TO_DATE
resultSec.task(':jaxbJavaGenTest04').outcome == UP_TO_DATE
resultSec.task(':jaxbJavaGenTest05').outcome == UP_TO_DATE
resultSec.task(':compileJava').outcome == UP_TO_DATE

where:
gradleVersion << supportedGradleVersions
}

def 'Test catalog-resolver - xjc'() {
given:
copyResources('samples/catalog-resolver')
Expand Down

0 comments on commit a45e94c

Please sign in to comment.