Skip to content

Commit

Permalink
Merge pull request #61 from nebula-plugins/fix-ide-integrations
Browse files Browse the repository at this point in the history
Fix IdeaPluginConfigurer and EclipsePluginConfigurer to use modern configurations
  • Loading branch information
rpalcolea authored Mar 27, 2020
2 parents ec7bd04 + 5d25107 commit 2403d8f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ facets {

Nebula IntegTest Plugin
=======================
A corrolary from the Facet Plugin is a concrete Facet, this plugin provides one specifically for Integration Tests. By applying this plugin, you'll get an `integrationTest` Test task, where sources go in `src/integTest/java` and dependencies can go into `integTestCompile` and `integTestRuntime` (which extend from the test SourceSet), with the 'check' task depending on the task. To apply the plugin:
A corrolary from the Facet Plugin is a concrete Facet, this plugin provides one specifically for Integration Tests. By applying this plugin, you'll get an `integrationTest` Test task, where sources go in `src/integTest/java` and dependencies can go into `integTestImplementation` and `integTestRuntimeOnly` (which extend from the test SourceSet), with the 'check' task depending on the task. To apply the plugin:

```groovy
apply plugin: 'nebula.integtest'
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dependencies {
compile 'com.netflix.nebula:gradle-contacts-plugin:4.0.2'
compile 'com.netflix.nebula:gradle-dependency-lock-plugin:6.1.2'
compile 'com.netflix.nebula:gradle-info-plugin:4.0.2'
testCompile 'com.netflix.nebula:nebula-test:7.1.7'
testImplementation 'com.netflix.nebula:nebula-test:7.1.7'
}

// We use hard coded versions here due to bundling compatibility, and we don't want to accidentally generate a lock file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class EclipsePluginConfigurer implements IdePluginConfigurer {
*/
private void configurePluginForSourceSet(SourceSet sourceSet) {
withEclipseModel { EclipseModel model ->
model.classpath.plusConfigurations += [ getConfiguration(sourceSet.compileConfigurationName) ]
model.classpath.plusConfigurations += [ getConfiguration(sourceSet.runtimeConfigurationName) ]
model.classpath.plusConfigurations += [ getConfiguration(sourceSet.compileClasspathConfigurationName) ]
model.classpath.plusConfigurations += [ getConfiguration(sourceSet.runtimeClasspathConfigurationName) ]
}
}

Expand All @@ -56,8 +56,8 @@ class EclipsePluginConfigurer implements IdePluginConfigurer {
*/
private void configurePluginForTestSourceSet(SourceSet sourceSet) {
withEclipseModel { EclipseModel model ->
model.classpath.plusConfigurations += [ getConfiguration(sourceSet.compileConfigurationName) ]
model.classpath.plusConfigurations += [ getConfiguration(sourceSet.runtimeConfigurationName) ]
model.classpath.plusConfigurations += [ getConfiguration(sourceSet.compileClasspathConfigurationName) ]
model.classpath.plusConfigurations += [ getConfiguration(sourceSet.runtimeClasspathConfigurationName) ]
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class IdeaPluginConfigurer implements IdePluginConfigurer {
module.testSourceDirs += srcDir
}

module.scopes.TEST.plus += [getConfiguration(testSourceSet.compileConfigurationName), getConfiguration(testSourceSet.runtimeConfigurationName)]
module.scopes.TEST.plus += [getConfiguration(testSourceSet.compileClasspathConfigurationName), getConfiguration(testSourceSet.runtimeClasspathConfigurationName)]
}
}

Expand All @@ -65,7 +65,7 @@ class IdeaPluginConfigurer implements IdePluginConfigurer {
module.sourceDirs += srcDir
}

module.scopes.COMPILE.plus += [getConfiguration(sourceSet.compileConfigurationName), getConfiguration(sourceSet.runtimeConfigurationName)]
module.scopes.COMPILE.plus += [getConfiguration(sourceSet.compileClasspathConfigurationName), getConfiguration(sourceSet.runtimeClasspathConfigurationName)]
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ abstract class AbstractNebulaIntegTestPluginLauncherSpec extends IntegrationSpec
}
dependencies {
testCompile 'junit:junit:latest.release'
testImplementation 'junit:junit:latest.release'
}
"""
}
Expand Down Expand Up @@ -76,8 +76,8 @@ abstract class AbstractNebulaIntegTestPluginLauncherSpec extends IntegrationSpec
}
dependencies {
integTestCompile 'foo:bar:2.4'
integTestRuntime 'custom:baz:5.1.27'
integTestImplementation 'foo:bar:2.4'
integTestRuntimeOnly 'custom:baz:5.1.27'
}
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class NebulaFacetPluginLauncherSpec extends IntegrationSpec {
}
dependencies {
functionalTestCompile 'foo:bar:2.4'
functionalTestRuntime 'custom:baz:5.1.27'
functionalTestImplementation 'foo:bar:2.4'
functionalTestRuntimeOnly 'custom:baz:5.1.27'
}
"""

Expand Down Expand Up @@ -80,8 +80,8 @@ class NebulaFacetPluginLauncherSpec extends IntegrationSpec {
}
dependencies {
myCustomCompile 'foo:bar:2.4'
myCustomRuntime 'custom:baz:5.1.27'
myCustomImplementation 'foo:bar:2.4'
myCustomRuntimeOnly 'custom:baz:5.1.27'
}
"""

Expand Down Expand Up @@ -121,8 +121,8 @@ class NebulaFacetPluginLauncherSpec extends IntegrationSpec {
}
dependencies {
myCustomCompile 'foo:bar:2.4'
myCustomRuntime 'custom:baz:5.1.27'
myCustomImplementation 'foo:bar:2.4'
myCustomRuntimeOnly 'custom:baz:5.1.27'
}
"""

Expand Down Expand Up @@ -317,8 +317,8 @@ ${applyPlugin(NebulaFacetPlugin)}
}
dependencies {
functionalTestCompile 'foo:bar:2.4'
functionalTestRuntime 'custom:baz:5.1.27'
functionalTestImplementation 'foo:bar:2.4'
functionalTestRuntimeOnly 'custom:baz:5.1.27'
}
"""
def result = runTasksSuccessfully('check', '--dry-run')
Expand Down

0 comments on commit 2403d8f

Please sign in to comment.