You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
import org.gradle.plugins.ide.eclipse.model.ProjectDependency
eclipse . classpath . file . whenMerged { classpath - >
// GRADLE-1116
def regexp = /.*?\/ ( [ ^ \ /]+)\/ build \ /[^\/ ] + \ /(?:main|test)/ // only match those that end in main or test (avoids removing necessary entries like build/classes/jaxb)
def projectOutputDependencies = classpath . entries . findAll { entry - > entry . path = ~ regexp }
projectOutputDependencies . each { entry - >
def matcher = ( entry . path = ~ regexp )
if ( matcher ) {
def projectName = matcher [ 0 ] [ 1 ]
def path = "/${projectName}"
if ( ! classpath . entries . find { e - > e instanceof ProjectDependency & & e . path = = path } ) {
def dependency = new ProjectDependency ( path , project ( ":${projectName}" ) . path )
dependency . exported = true
classpath . entries . add ( dependency )
}
classpath . entries . remove ( entry )
}
}
classpath . entries . removeAll { entry - > ( entry . path = ~ /(?!.*?repack.*\.jar).*?\/ ( [ ^ \ /]+)\/ build \ /libs\/ [ ^ \ /]+\.jar/ ) }
}