Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependencies on deprecated Gradle feature #1278

Merged
merged 5 commits into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gradlew linguist-generated=true
gradlew.bat linguist-generated=true
24 changes: 23 additions & 1 deletion eclipsePlugin-junit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
apply from: "$rootDir/gradle/checkstyle.gradle"
apply from: "$rootDir/gradle/jacoco.gradle"

def localProps = new Properties()
localProps.load(new FileInputStream("$rootDir/eclipsePlugin/local.properties"))

def eclipseRootDir = file(localProps.getProperty('eclipseRoot.dir'))
// Eclipse 4.5+ uses a different directory layout under macOS. Try to detect this first.
def eclipseExecutable = new File(eclipseRootDir, "Contents/MacOS/eclipse")
def eclipsePluginsDir = new File(eclipseRootDir, "Contents/Eclipse/plugins")
if (!eclipseExecutable.exists()) {
// Fall back to non-macOS directory layout.
eclipsePluginsDir = new File(eclipseRootDir, "plugins")
}

dependencies {
implementation project(':eclipsePlugin')
testImplementation project(path: ':eclipsePlugin', configuration: 'compileOnly')
testImplementation 'junit:junit:4.13'
testImplementation 'org.mockito:mockito-core:3.5.10'

// List below includes all Eclipse SDK plugins except few causing troubles.
// TODO: it should include what is required in the MANIFEST.MF, and nothing else
testImplementation fileTree(dir:eclipsePluginsDir, include:'**/*.jar',
exclude:[
'**/datanucleus-enhancer*.jar',
'edu.umd.cs.findbugs.**/*.jar',
'org.mockito*.jar',
'com.github.spotbugs.**/*.jar',
'**/*source_*.jar'
])
}

jacocoTestReport {
Expand Down
23 changes: 22 additions & 1 deletion eclipsePlugin-test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
apply from: "$rootDir/gradle/checkstyle.gradle"

def localProps = new Properties()
localProps.load(new FileInputStream("$rootDir/eclipsePlugin/local.properties"))

def eclipseRootDir = file(localProps.getProperty('eclipseRoot.dir'))
// Eclipse 4.5+ uses a different directory layout under macOS. Try to detect this first.
def eclipseExecutable = new File(eclipseRootDir, "Contents/MacOS/eclipse")
def eclipsePluginsDir = new File(eclipseRootDir, "Contents/Eclipse/plugins")
if (!eclipseExecutable.exists()) {
// Fall back to non-macOS directory layout.
eclipsePluginsDir = new File(eclipseRootDir, "plugins")
}

sourceSets {
main {
java {
Expand All @@ -17,7 +29,16 @@ dependencies {
implementation(project(':eclipsePlugin')) {
transitive = true
}
implementation project(path: ':eclipsePlugin', configuration: 'compileOnly')
// List below includes all Eclipse SDK plugins except few causing troubles.
// TODO: it should include what is required in the MANIFEST.MF, and nothing else
compileOnly fileTree(dir:eclipsePluginsDir, include:'**/*.jar',
exclude:[
'**/datanucleus-enhancer*.jar',
'edu.umd.cs.findbugs.**/*.jar',
'org.mockito*.jar',
'com.github.spotbugs.**/*.jar',
'**/*source_*.jar'
])

implementation project(':test-harness')
implementation 'org.hamcrest:hamcrest-all:1.3'
Expand Down
2 changes: 1 addition & 1 deletion eclipsePlugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def eclipsePluginId = 'com.github.spotbugs.plugin.eclipse'
def localProps = new Properties()
localProps.load(new FileInputStream("$projectDir/local.properties"))

def eclipseRootDir = new File(localProps.getProperty('eclipseRoot.dir'))
def eclipseRootDir = file(localProps.getProperty('eclipseRoot.dir'))
// Eclipse 4.5+ uses a different directory layout under macOS. Try to detect this first.
def eclipseExecutable = new File(eclipseRootDir, "Contents/MacOS/eclipse")
def eclipsePluginsDir = new File(eclipseRootDir, "Contents/Eclipse/plugins")
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-6.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 2 additions & 0 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.