From 7e34be04db12f5fa04097e32658f2251293e0818 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Fri, 8 Nov 2019 06:50:59 -0600 Subject: [PATCH] Revert "HHH-13656 Can not build and run test on Eclipse IDE" This reverts commit 0f859e7bb4d9bb8ce83fc7fd0de12d141195695c. --- hibernate-core/hibernate-core.gradle | 82 +++++++++++++--------- hibernate-testing/hibernate-testing.gradle | 2 + 2 files changed, 49 insertions(+), 35 deletions(-) diff --git a/hibernate-core/hibernate-core.gradle b/hibernate-core/hibernate-core.gradle index dec98bac8a..3dda5a1b54 100644 --- a/hibernate-core/hibernate-core.gradle +++ b/hibernate-core/hibernate-core.gradle @@ -191,31 +191,24 @@ eclipse { project { file { withXml { provider -> - //println('name:') - //println(name) def projectDescriptionNode = provider.asNode() +// projectDescriptionNode.children( ).each { nodeItem -> +// println( 'nodeItem: ' + nodeItem ) +// } def buildSpecNode = projectDescriptionNode.children().find { child -> child.name( ).equals('buildSpec') } - def buildCommandSW = new StringWriter() - def buildCommandXml = new MarkupBuilder(new IndentPrinter(buildCommandSW, " ", true)) - buildCommandXml.doubleQuotes = true - buildCommandXml.buildCommand( ) { - //[java - Groovy's MarkupBuilder exception on generating "id" XML tag - Stack Overflow](https://stackoverflow.com/a/14284927/1350308) - "${'name'}"( "org.eclipse.ui.externaltools.ExternalToolBuilder" ) { } - triggers( 'auto,full,incremental,' ) - arguments( ) { - dictionary( ) { - key ( 'LaunchConfigHandle' ) - value ( '/.externalToolBuilders/gradlew_process_test_resources.launch' ) - } - dictionary( ) { - key ( 'incclean' ) - value ( true ) + def buildCommandMkp = new StreamingMarkupBuilder().bind { + buildCommand { + name( 'org.eclipse.ui.externaltools.ExternalToolBuilder' ) + triggers( 'full,incremental,' ) + arguments( ) { + dictionary( ) { + key ( 'LaunchConfigHandle' ) + value ( '/.externalToolBuilders/gradlew_process_test_resources.launch' ) + } } } } - def buildCommandNode = new XmlParser().parseText( buildCommandSW.toString() ) - //println('strWriter:') - //println(buildCommandSW.toString()) + def buildCommandNode = new XmlParser().parseText( buildCommandMkp.toString() ) buildSpecNode.append( buildCommandNode ) } } @@ -236,18 +229,9 @@ eclipse { } else { stringAttribute( key: 'org.eclipse.ui.externaltools.ATTR_LOCATION', value: file('../gradlew').absolutePath ) } - booleanAttribute( key:'org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND', value: false ) - stringAttribute( - key: 'org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE', - value: '\${working_set: \ - \ - \ - \ - }' - ) stringAttribute( key: 'org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS', value: 'incremental,auto,' ) stringAttribute( key: 'org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS', value: 'hibernate-core:processTestResources --no-daemon' ) - booleanAttribute( key: 'org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED', value: true ) + booleanAttribute( key: 'org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED', value: 'true' ) stringAttribute( key: 'org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY', value: file('../').absolutePath ) } xml.mkp.comment("AUTO-GENERATED FILE. DO NOT MODIFY. This is generated by gradle eclipse task") @@ -267,10 +251,10 @@ eclipse { } stringAttribute( key: 'org.eclipse.jdt.junit.CONTAINER', value: "=${project.name}" ) stringAttribute( key: 'org.eclipse.jdt.junit.EXCLUDE_TAGS', value: '' ) - booleanAttribute( key: 'org.eclipse.jdt.junit.HAS_EXCLUDE_TAGS', value: false ) - booleanAttribute( key: 'org.eclipse.jdt.junit.HAS_INCLUDE_TAGS', value: true ) + booleanAttribute( key: 'org.eclipse.jdt.junit.HAS_EXCLUDE_TAGS', value: 'false' ) + booleanAttribute( key: 'org.eclipse.jdt.junit.HAS_INCLUDE_TAGS', value: 'true' ) stringAttribute( key: 'org.eclipse.jdt.junit.INCLUDE_TAGS', value: 'RunnableIdeTest' ) - booleanAttribute( key: 'org.eclipse.jdt.junit.KEEPRUNNING_ATTR', value: false ) + booleanAttribute( key: 'org.eclipse.jdt.junit.KEEPRUNNING_ATTR', value: 'false' ) stringAttribute( key: 'org.eclipse.jdt.junit.TESTNAME', value: '' ) stringAttribute( key: 'org.eclipse.jdt.junit.TEST_KIND', value: 'org.eclipse.jdt.junit.loader.junit5' ) stringAttribute( key: 'org.eclipse.jdt.launching.MAIN_TYPE', value: '' ) @@ -298,10 +282,10 @@ eclipse { List newSourceSet = [] classpath.entries.each { item -> if( !exclusionSourceSet.contains( item.path ) ) { - //println( 'INCLUDING: ' + item ) + println( 'INCLUDING: ' + item ) newSourceSet.add( item ) } else { - //println( 'NOT INCLUDING: ' + item ) + println( 'NOT INCLUDING: ' + item ) } } @@ -315,7 +299,35 @@ eclipse { resourceMain, resourceTest ] +// def resourceMain = new Library( frf.fromFile( file ( 'target/resources/main' ) ) ) +// def resourceTest = new Library( frf.fromFile( file ( 'target/resources/test' ) ) ) + println( 'newSourceSet:' ) + println( newSourceSet ) classpath.entries = newSourceSet + +// classpath.configure([ +// aptMain, +// aptTest, +// resourceMain, +// resourceTest +// ]) + + // Find the "source" entry and add the exclude for the folder containing our super-source code +// Set exclusionSourceSet = [ +// 'src/main/resources', +// 'src/test/resources' +// ] +// Set newSourceSet = [] +// classpath.entries.each { item -> +// if( !exclusionSourceSet.contains( item.path ) ) { +// println( 'INCLUDING: ' + item ) +// newSourceSet.add( item ) +// } else { +// println( 'NOT INCLUDING: ' + item ) +// } +// } +// println( 'newSourceSet:' ) +// println( newSourceSet ) } } } diff --git a/hibernate-testing/hibernate-testing.gradle b/hibernate-testing/hibernate-testing.gradle index 44351eecb7..151a558b5b 100644 --- a/hibernate-testing/hibernate-testing.gradle +++ b/hibernate-testing/hibernate-testing.gradle @@ -63,6 +63,8 @@ eclipse { //println( 'NOT INCLUDING: ' + item ) } } + println( 'newSourceSet:' ) + println( newSourceSet ) def hibernateCore = new ProjectDependency('/hibernate-core') newSourceSet += [