Skip to content
This repository has been archived by the owner on Feb 7, 2021. It is now read-only.

Commit

Permalink
Make sure we can apply the plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalcolea committed Mar 26, 2019
1 parent 633b44b commit 9c74c03
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 9 deletions.
7 changes: 4 additions & 3 deletions src/main/kotlin/nebula/plugin/bintray/BintrayExtension.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package nebula.plugin.bintray

import org.gradle.api.model.ObjectFactory
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.Property
import org.gradle.kotlin.dsl.property

Expand All @@ -13,9 +14,9 @@ open class BintrayExtension(objects: ObjectFactory) {
val userOrg: Property<String> = objects.property()
val autoPublish: Property<Boolean> = objects.property()
val autoPublishWaitForSeconds: Property<Int> = objects.property()
val licenses: Property<List<String>> = objects.property()
val customLicenses: Property<List<String>> = objects.property()
val labels: Property<List<String>> = objects.property()
val licenses: ListProperty<String> = objects.listProperty(String::class.java)
val customLicenses: ListProperty<String> = objects.listProperty(String::class.java)
val labels: ListProperty<String> = objects.listProperty(String::class.java)
val websiteUrl: Property<String> =objects.property()
val issueTrackerUrl: Property<String> = objects.property()
val vcsUrl: Property<String> = objects.property()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package nebula.plugin.bintray

import org.gradle.api.GradleException
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Optional
Expand All @@ -14,13 +14,13 @@ open class NebulaBintrayPackageTask : NebulaBintrayAbstractTask() {
val desc: Property<String> = project.objects.property()
@Input
@Optional
val licenses: Property<List<String>> = project.objects.property()
val licenses: ListProperty<String> = project.objects.listProperty(String::class.java)
@Input
@Optional
val customLicenses: Property<List<String>> = project.objects.property()
val customLicenses: ListProperty<String> = project.objects.listProperty(String::class.java)
@Input
@Optional
val labels: Property<List<String>> = project.objects.property()
val labels:ListProperty<String> = project.objects.listProperty(String::class.java)
@Input
@Optional
val websiteUrl: Property<String> = project.objects.property()
Expand Down
24 changes: 24 additions & 0 deletions src/test/groovy/nebula/plugin/bintray/LauncherSpec.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package nebula.plugin.bintray

import nebula.test.IntegrationSpec
import spock.lang.Ignore

class LauncherSpec extends IntegrationSpec {
@Ignore
File createSubProject(String name, String buildFile = null) {
settingsFile << "\ninclude '${name}'"

def sub = new File(projectDir, name)
sub.mkdirs()

if (buildFile) {
new File(sub, 'build.gradle') << buildFile
}

return sub
}

void writeHelloWorld(String dottedPackage = 'netflix.hello') {
writeHelloWorld(dottedPackage, getProjectDir())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,33 @@
*/
package nebula.plugin.bintray

import nebula.test.IntegrationSpec

class NebulaBintrayPublishingPluginIntegrationSpec extends IntegrationSpec {
class NebulaBintrayPublishingPluginIntegrationSpec extends LauncherSpec {

def 'apply plugin'() {
given:
buildFile << """
apply plugin: 'nebula.nebula-bintray'
apply plugin: 'java'
group = 'test.nebula.netflix'
version = '1.0'
bintray {
user = 'nebula-plugins'
apiKey = 'mykey'
apiUrl = 'https://api.bintray.com'
pkgName = 'my-plugin'
}
"""

writeHelloWorld()

when:
def result = runTasks('publishPackageToBintray')

then:
result.standardOutput.contains('Task :publishPackageToBintray')
}
}

0 comments on commit 9c74c03

Please sign in to comment.