Skip to content
Permalink
Browse files

Prepare the build for a binary release

  • Loading branch information
lacasseio committed Mar 19, 2020
1 parent b6ed34b commit add2d57071c62f88d1b93ba818e2df274319b174
Showing with 4,411 additions and 64 deletions.
  1. +2 −2 build.gradle
  2. +0 −24 settings.gradle
  3. +46 −9 subprojects/gradle-api/build.gradle
  4. +107 −15 subprojects/gradle-fixtures/build.gradle
  5. +174 −0 .../spock/groovy/dev/gradleplugins/integtests/fixtures/AbstractContextualMultiVersionSpecRunner.java
  6. +152 −0 ...dle-fixtures/src/spock/groovy/dev/gradleplugins/integtests/fixtures/AbstractFunctionalSpec.groovy
  7. +470 −0 ...adle-fixtures/src/spock/groovy/dev/gradleplugins/integtests/fixtures/AbstractMultiTestRunner.java
  8. +79 −0 ...adle-fixtures/src/spock/groovy/dev/gradleplugins/integtests/fixtures/WellBehavedPluginTest.groovy
  9. +184 −0 ...gradleplugins/integtests/fixtures/nativeplatform/AbstractInstalledToolChainIntegrationSpec.groovy
  10. +1,083 −0 ...es/src/spock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/AvailableToolChains.java
  11. +35 −0 ...es/src/spock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/ExecutableFixture.groovy
  12. +38 −0 ...ixtures/src/spock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/HostPlatform.groovy
  13. +40 −0 ...src/spock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/LinkerOptionsFixture.groovy
  14. +161 −0 .../src/spock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/NativeBinaryFixture.groovy
  15. +79 −0 ...pock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/NativeInstallationFixture.groovy
  16. +119 −0 .../spock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/NativeToolChainTestRunner.java
  17. +28 −0 ...ock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/RequiresInstalledToolChain.groovy
  18. +39 −0 ...y/dev/gradleplugins/integtests/fixtures/nativeplatform/RequiresInstalledToolChainExtension.groovy
  19. +61 −0 ...src/spock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/SharedLibraryFixture.groovy
  20. +29 −0 ...src/spock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/StaticLibraryFixture.groovy
  21. +64 −0 ...s/src/spock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/ToolChainRequirement.java
  22. +63 −0 .../src/spock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/binaryinfo/BinaryInfo.java
  23. +129 −0 ...k/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/binaryinfo/DumpbinBinaryInfo.groovy
  24. +42 −0 ...v/gradleplugins/integtests/fixtures/nativeplatform/binaryinfo/DumpbinGccProducedBinaryInfo.groovy
  25. +71 −0 ...ovy/dev/gradleplugins/integtests/fixtures/nativeplatform/binaryinfo/FileArchOnlyBinaryInfo.groovy
  26. +57 −0 ...spock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/binaryinfo/NMToolFixture.groovy
  27. +89 −0 ...ock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/binaryinfo/OtoolBinaryInfo.groovy
  28. +117 −0 ...k/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/binaryinfo/ReadelfBinaryInfo.groovy
  29. +47 −0 ...oovy/dev/gradleplugins/integtests/fixtures/nativeplatform/internal/NativeServicesTestFixture.java
  30. +179 −0 ...res/src/spock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/internal/TestFiles.java
  31. +41 −0 ...y/dev/gradleplugins/integtests/fixtures/nativeplatform/msvcpp/VisualStudioLocatorTestFixture.java
  32. +43 −0 ...spock/groovy/dev/gradleplugins/integtests/fixtures/nativeplatform/msvcpp/VisualStudioVersion.java
  33. +167 −0 .../gradle-fixtures/src/spock/groovy/dev/gradleplugins/spock/lang/AbstractTestDirectoryProvider.java
  34. +40 −0 subprojects/gradle-fixtures/src/spock/groovy/dev/gradleplugins/spock/lang/CleanupTestDirectory.java
  35. +61 −0 .../gradle-fixtures/src/spock/groovy/dev/gradleplugins/spock/lang/CleanupTestDirectoryExtension.java
  36. +106 −0 subprojects/gradle-fixtures/src/spock/groovy/dev/gradleplugins/spock/lang/FileUtils.java
  37. +36 −0 subprojects/gradle-fixtures/src/spock/groovy/dev/gradleplugins/spock/lang/TestDirectoryProvider.java
  38. +49 −0 .../gradle-fixtures/src/spock/groovy/dev/gradleplugins/spock/lang/TestNameTestDirectoryProvider.java
  39. +0 −8 subprojects/gradle-plugin-development-annotation/build.gradle
  40. +83 −5 subprojects/gradle-plugin-development/build.gradle
  41. +1 −1 version.txt
@@ -1,5 +1,5 @@
import dev.gradleplugins.GitHubSourceControlManagerPlugin
import dev.gradleplugins.GitHubSourceControlManagerExtension
import dev.gradleplugins.GitHubSourceControlManagerPlugin
import dev.gradleplugins.OpenSourceSoftwareLicensePlugin

plugins {
@@ -8,8 +8,8 @@ plugins {
}

allprojects {
group = 'dev.gradleplugins'
version = rootProject.file('version.txt').text
group = 'dev.gradleplugins'

apply plugin: GitHubSourceControlManagerPlugin
extensions.configure(GitHubSourceControlManagerExtension) {
@@ -1,23 +1,3 @@
pluginManagement {
if (System.getProperty('dev.gradleplugins.useLocal') != null && (System.getProperty('dev.gradleplugins.useLocal') == "true" || System.getProperty('dev.gradleplugins.useLocal') == '')) {

repositories {
mavenLocal()
gradlePluginPortal()
}

def version = file("version.txt").text
resolutionStrategy {
eachPlugin {
if (requested.id.namespace == 'dev.gradleplugins') {
useModule("dev.gradleplugins:gradle-plugin-development:${version}")
}
}
}
}
}


rootProject.name = 'toolbox'


@@ -26,10 +6,6 @@ include('gradle-api')
project(':gradle-api').projectDir = file('subprojects/gradle-api')
include('gradle-fixtures')
project(':gradle-fixtures').projectDir = file('subprojects/gradle-fixtures')
include('spock-gradle-fixtures')
project(':spock-gradle-fixtures').projectDir = file('subprojects/spock-gradle-fixtures')
include('spock-test-directory-extension')
project(':spock-test-directory-extension').projectDir = file('subprojects/spock-test-directory-extension')

// Plugins
include('license-gradle-plugin')
@@ -14,18 +14,18 @@
* limitations under the License.
*/

import com.jfrog.bintray.gradle.BintrayExtension
import com.jfrog.bintray.gradle.tasks.BintrayUploadTask
import org.gradle.api.publish.maven.internal.artifact.FileBasedMavenArtifact

import java.text.SimpleDateFormat

plugins {
id 'dev.gradleplugins.build.gradle-api-jars'
id 'com.jfrog.bintray'
id 'maven-publish'
id 'dev.gradleplugins.experimental.publishing-base'
}

version = null
version = '6.2.2'

// Temporary workaround for https://github.com/bintray/gradle-bintray-plugin/issues/229
PublishingExtension publishing = project.extensions.getByType(PublishingExtension)
@@ -47,14 +47,51 @@ project.tasks.withType(BintrayUploadTask).configureEach {
}
}

private String resolveProperty(Project project, String envVarKey, String projectPropKey) {
Object propValue = System.getenv().get(envVarKey);

if (propValue != null) {
return propValue.toString();
}

propValue = project.findProperty(projectPropKey);
if (propValue != null) {
return propValue.toString();
}

return null;
}


afterEvaluate {
extensions.configure(BintrayExtension) { bintray ->
bintray.publications = publishing.publications.collect { it.name }
bintray.override = true
bintray.pkg {
name = "gradle-api-jars"
setLabels("gradle", "gradle-api", "gradle-plugins")
bintray {
user = resolveProperty(project, "BINTRAY_USER", "dev.gradleplugins.bintray.user")
key = resolveProperty(project, "BINTRAY_KEY", "dev.gradleplugins.bintray.key")
publications = publishing.publications.collect { it.name }

publish = true
override = true // only for snapshot

pkg {
repo = 'distributions'
name = 'dev.gradleplugins:gradle-api'
desc = project.description
userOrg = 'gradle-plugins'
websiteUrl = 'https://nokee.dev'
issueTrackerUrl = 'https://github.com/gradle-plugins/toolbox/issues'
vcsUrl = 'https://github.com/gradle-plugins/toolbox.git'
labels = ['gradle', 'gradle-api', 'gradle-plugins']
licenses = ['Apache-2.0']
publicDownloadNumbers = false

version {
released = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZZ").format(new Date())
// TODO: Sign artifacts
gpg {
sign = false
passphrase = resolveProperty(project, "GPG_PASSPHRASE", "dev.gradleplugins.bintray.gpgPassphrase")
}
}
}
}
}
@@ -1,18 +1,35 @@
import com.jfrog.bintray.gradle.BintrayExtension
import com.jfrog.bintray.gradle.tasks.BintrayUploadTask
import org.gradle.api.publish.maven.internal.artifact.FileBasedMavenArtifact

import java.text.SimpleDateFormat

plugins {
id 'java-library'
id 'groovy' // for Spock framework
id 'dev.gradleplugins.experimental.shaded-artifact'
id 'dev.gradleplugins.experimental.artifacts'
id 'dev.gradleplugins.experimental.publishing'
id 'maven-publish'
id 'com.jfrog.bintray'
}

description = "Gradle TestKit fixtures for fast and efficient Gradle plugin development."

sourceSets {
spockSupport {
groovy {
srcDir 'src/spock/groovy'
}
}
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
withJavadocJar()
registerFeature('spockSupport') {
usingSourceSet(sourceSets.spockSupport)
withSourcesJar()
withJavadocJar()
}
}

repositories {
@@ -42,32 +59,107 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok:1.18.12'

testImplementation 'org.spockframework:spock-core:1.2-groovy-2.5'
testImplementation project(':spock-test-directory-extension')
// testImplementation project(':spock-test-directory-extension')
implementation 'junit:junit:4.12'




spockSupportApi project(':gradle-fixtures')

spockSupportImplementation gradleTestKit()
spockSupportImplementation 'com.google.guava:guava:28.2-jre'

// This is tricky as it's a API dependency but may work for other versions
// Let's put the burden on the user to declare his requirements but also assume the code is compatible with older versions ;)
// TODO: At some point, we will need make this work with an "older" version of Spock depending on how backward compatible the Gradle plugin development plugins will support.
spockSupportImplementation 'org.spockframework:spock-core:1.2-groovy-2.5'
// spockSupportApi project(':spock-test-directory-extension')
}




publishing {
publications {
mavenJava {
mavenJava(MavenPublication) {
from(components.java)
}
}
repositories {
mavenLocal()
}
}

afterEvaluate {
extensions.getByType(BintrayExtension).with {
pkg {
name = "testkit-fixtures"
// Temporary workaround for https://github.com/bintray/gradle-bintray-plugin/issues/229
PublishingExtension publishing = project.extensions.getByType(PublishingExtension)
project.tasks.withType(BintrayUploadTask).configureEach {
doFirst {
publishing.publications.withType(MavenPublication).each { publication ->
File moduleFile = project.buildDir.toPath()
.resolve("publications/${publication.name}/module.json").toFile()

if (moduleFile.exists()) {
publication.artifact(new FileBasedMavenArtifact(moduleFile) {
@Override
protected String getDefaultExtension() {
return "module"
}
})
}
}
}
}

tasks.register("release") {
dependsOn("bintrayUpload")
private String resolveProperty(Project project, String envVarKey, String projectPropKey) {
Object propValue = System.getenv().get(envVarKey);

if (propValue != null) {
return propValue.toString();
}

propValue = project.findProperty(projectPropKey);
if (propValue != null) {
return propValue.toString();
}

return null;
}

tasks.register("install") {
dependsOn("publishToMavenLocal")

afterEvaluate {
bintray {
user = resolveProperty(project, "BINTRAY_USER", "dev.gradleplugins.bintray.user")
key = resolveProperty(project, "BINTRAY_KEY", "dev.gradleplugins.bintray.key")
publications = publishing.publications.collect { it.name }

publish = true
override = System.getProperties().containsKey('force')

pkg {
repo = 'distributions'
name = 'dev.gradleplugins:gradle-fixtures'
desc = project.description
userOrg = 'gradle-plugins'
websiteUrl = 'https://nokee.dev'
issueTrackerUrl = 'https://github.com/gradle-plugins/toolbox/issues'
vcsUrl = 'https://github.com/gradle-plugins/toolbox.git'
labels = ['gradle', 'gradle-api', 'gradle-plugins']
licenses = ['Apache-2.0']
publicDownloadNumbers = false

version {
released = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZZ").format(new Date())
// TODO: Sign artifacts
gpg {
sign = false
passphrase = resolveProperty(project, "GPG_PASSPHRASE", "dev.gradleplugins.bintray.gpgPassphrase")
}
}
}
}
}

// TODO: fix all javadoc issues
tasks.register('release') {
dependsOn('bintrayUpload')
}

0 comments on commit add2d57

Please sign in to comment.
You can’t perform that action at this time.