2018-01-11 04:36:57 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// plugin configuration must precede everything else
|
|
|
|
//
|
|
|
|
|
|
|
|
plugins {
|
2018-02-14 20:53:56 +00:00
|
|
|
id 'com.diffplug.gradle.p2.asmaven' version '3.10.0'
|
2018-01-11 04:36:57 +00:00
|
|
|
id 'com.github.hauner.jarTest' version '1.0.1' apply false
|
2018-03-05 18:33:29 +00:00
|
|
|
id 'de.undercouch.download'
|
2018-01-11 04:36:57 +00:00
|
|
|
id 'nebula.lint' version '8.3.1'
|
2018-05-28 17:42:04 +00:00
|
|
|
id 'nebula.source-jar' version '7.0.1' apply false
|
2018-01-11 04:36:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-02-14 20:53:56 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// required Eclipse components
|
|
|
|
//
|
|
|
|
|
|
|
|
p2AsMaven {
|
|
|
|
group 'eclipse-deps', {
|
|
|
|
repoEclipse '4.7.2'
|
|
|
|
slicingOption 'latestVersionOnly', 'true'
|
|
|
|
iu 'org.eclipse.core.commands'
|
2018-02-14 23:46:05 +00:00
|
|
|
iu 'org.eclipse.core.contenttype'
|
2018-02-14 20:53:56 +00:00
|
|
|
iu 'org.eclipse.core.jobs'
|
|
|
|
iu 'org.eclipse.core.resources'
|
|
|
|
iu 'org.eclipse.core.runtime'
|
|
|
|
iu 'org.eclipse.equinox.app'
|
|
|
|
iu 'org.eclipse.equinox.common'
|
2018-02-14 23:46:05 +00:00
|
|
|
iu 'org.eclipse.equinox.preferences'
|
2018-02-14 20:53:56 +00:00
|
|
|
iu 'org.eclipse.jdt.core'
|
|
|
|
iu 'org.eclipse.jface'
|
|
|
|
iu 'org.eclipse.osgi'
|
|
|
|
iu 'org.eclipse.pde.core'
|
|
|
|
iu 'org.eclipse.swt'
|
|
|
|
iu 'org.eclipse.ui.ide'
|
|
|
|
iu 'org.eclipse.ui.workbench'
|
|
|
|
}
|
2018-02-14 21:11:00 +00:00
|
|
|
group 'wst-deps', {
|
|
|
|
repo 'http://download.eclipse.org/releases/oxygen'
|
|
|
|
slicingOption 'latestVersionOnly', 'true'
|
|
|
|
iu 'org.eclipse.wst.jsdt.core'
|
|
|
|
iu 'org.eclipse.wst.jsdt.ui'
|
|
|
|
}
|
2018-02-14 20:53:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-12-19 22:31:44 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2017-12-21 15:06:59 +00:00
|
|
|
// common Java setup shared by multiple projects
|
2017-12-19 22:31:44 +00:00
|
|
|
//
|
|
|
|
|
2018-02-25 23:25:09 +00:00
|
|
|
group name
|
2018-08-22 19:01:19 +00:00
|
|
|
version '1.5.1-SNAPSHOT'
|
2018-02-01 17:29:26 +00:00
|
|
|
|
2017-12-15 19:27:08 +00:00
|
|
|
subprojects { subproject ->
|
|
|
|
// skip generic Java setup for the few projects that have no Java code whatsoever
|
|
|
|
switch (subproject.name) {
|
|
|
|
case 'com.ibm.wala-repository':
|
|
|
|
case ~/.*_feature/:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin: 'java'
|
2018-02-25 23:25:09 +00:00
|
|
|
apply plugin: 'maven-publish'
|
|
|
|
apply plugin: 'nebula.source-jar'
|
2017-12-15 19:27:08 +00:00
|
|
|
|
2018-02-25 23:25:09 +00:00
|
|
|
version rootProject.version
|
|
|
|
|
2017-12-15 19:27:08 +00:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2018-02-14 20:53:56 +00:00
|
|
|
maven {
|
|
|
|
url "$rootProject.buildDir/p2asmaven/maven"
|
|
|
|
}
|
2017-12-15 19:27:08 +00:00
|
|
|
}
|
2018-02-12 16:42:37 +00:00
|
|
|
|
2018-03-22 04:07:22 +00:00
|
|
|
jar.manifest.from('META-INF/MANIFEST.MF')
|
|
|
|
|
2018-07-12 23:17:02 +00:00
|
|
|
publishing.publications {
|
|
|
|
mavenJava(MavenPublication) {
|
|
|
|
from components.java
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-28 18:23:26 +00:00
|
|
|
task afterEclipseBuildshipImport(dependsOn: processTestResources)
|
2018-07-12 18:53:37 +00:00
|
|
|
task prepareIntelliJIDEA
|
2018-02-25 21:53:31 +00:00
|
|
|
|
|
|
|
test {
|
|
|
|
include '**/*Test.class'
|
|
|
|
include '**/*TestCase.class'
|
|
|
|
include '**/*Tests.class'
|
|
|
|
include '**/Test*.class'
|
|
|
|
exclude '**/*AndroidLibs*.class'
|
2018-03-31 23:15:40 +00:00
|
|
|
|
|
|
|
maxParallelForks = Integer.MAX_VALUE
|
2018-02-25 21:53:31 +00:00
|
|
|
}
|
2017-12-21 15:06:59 +00:00
|
|
|
}
|
|
|
|
|
2018-02-28 18:23:26 +00:00
|
|
|
task afterEclipseBuildshipImport(type: Exec) {
|
|
|
|
commandLine './revert-launchers.sh'
|
|
|
|
}
|
|
|
|
|
2017-12-21 15:06:59 +00:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// find platform-specific SWT implementations
|
|
|
|
//
|
|
|
|
|
|
|
|
def osgi_platform
|
|
|
|
|
|
|
|
switch (System.getProperty('os.name')) {
|
|
|
|
case ~/Mac OS X/:
|
|
|
|
osgi_platform = 'cocoa.macosx.x86_64'
|
|
|
|
break
|
|
|
|
case ~/Windows.*/:
|
|
|
|
osgi_platform = 'win32.win32.x86_64'
|
|
|
|
break
|
|
|
|
case ~/Linux/:
|
|
|
|
osgi_platform = 'gtk.linux.x86_64'
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
System.setProperty('osgi.platform', osgi_platform)
|
2017-12-15 19:27:08 +00:00
|
|
|
|
2017-12-21 15:06:59 +00:00
|
|
|
subprojects {
|
2017-12-15 19:27:08 +00:00
|
|
|
configurations.all {
|
|
|
|
resolutionStrategy {
|
|
|
|
// failOnVersionConflict()
|
|
|
|
dependencySubstitution {
|
2018-02-14 20:53:56 +00:00
|
|
|
substitute module('eclipse-deps:org.eclipse.swt.${osgi.platform}') with module("eclipse-deps:org.eclipse.swt.${System.getProperty('osgi.platform')}:3.+")
|
2017-12-15 19:27:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-12-19 16:17:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
2017-12-19 22:31:44 +00:00
|
|
|
//
|
|
|
|
// optional lint checking of Gradle scripts
|
|
|
|
//
|
2017-12-19 16:17:47 +00:00
|
|
|
|
|
|
|
allprojects {
|
|
|
|
apply plugin: 'nebula.lint'
|
2018-01-17 20:53:19 +00:00
|
|
|
gradleLint.alwaysRun = false
|
2017-12-21 15:07:48 +00:00
|
|
|
gradleLint {
|
|
|
|
rules = ['all-dependency']
|
|
|
|
excludedRules = [
|
|
|
|
'duplicate-dependency-class',
|
|
|
|
'transitive-duplicate-dependency-class',
|
2018-02-14 22:03:59 +00:00
|
|
|
'unused-dependency',
|
2017-12-21 15:07:48 +00:00
|
|
|
]
|
|
|
|
}
|
2017-12-19 16:17:47 +00:00
|
|
|
}
|
2017-12-19 22:32:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// disable Javadoc linter until documentation is in better shape
|
|
|
|
//
|
|
|
|
|
|
|
|
allprojects {
|
|
|
|
tasks.withType(Javadoc) {
|
|
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
|
|
}
|
|
|
|
}
|
2018-07-25 21:57:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Eclipse IDE integration
|
|
|
|
//
|
|
|
|
|
|
|
|
// workaround for <https://github.com/gradle/gradle/issues/4802>
|
|
|
|
allprojects {
|
|
|
|
apply plugin: 'eclipse'
|
|
|
|
|
|
|
|
eclipse.classpath.file.whenMerged {
|
|
|
|
entries.each {
|
|
|
|
if (it in org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry && it.entryAttributes['gradle_used_by_scope'] == 'test')
|
|
|
|
it.entryAttributes['test'] = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|