Revert "HHH-13656 Can not build and run test on Eclipse IDE"

This reverts commit 0f859e7bb4.
This commit is contained in:
Steve Ebersole 2019-11-08 06:50:59 -06:00
parent 2cc517e349
commit 7e34be04db
2 changed files with 49 additions and 35 deletions

View File

@ -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 ( '<project>/.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 ( '<project>/.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:<?xml version="1.0" encoding="UTF-8"?> \
<resources> \
<item path="/'+"${project.name}"+'/src/test/bundles" type="2"/> \
<item path="/'+"${project.name}"+'/src/test/resources" type="2"/> \
</resources>}'
)
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 )
}
}
}

View File

@ -63,6 +63,8 @@ eclipse {
//println( 'NOT INCLUDING: ' + item )
}
}
println( 'newSourceSet:' )
println( newSourceSet )
def hibernateCore = new ProjectDependency('/hibernate-core')
newSourceSet += [