Compare commits
12 Commits
b4453643d9
...
c673c36e20
Author | SHA1 | Date |
---|---|---|
Schalk W. Cronjé | c673c36e20 | |
Schalk Cronje | 98a282d204 | |
Lóránt Pintér | 6b47d5dca7 | |
Schalk W. Cronjé | 218b74701a | |
Schalk Cronje | 08751e9317 | |
Schalk Cronje | 2304bd4d4e | |
Schalk W. Cronjé | 608805bd8a | |
Schalk Cronje | 65871700bc | |
Schalk Cronje | d2c32b51ac | |
Schalk Cronje | c55d80b4cb | |
Schalk W. Cronjé | 3a850814c1 | |
Schalk W. Cronjé | 76aa4fb697 |
|
@ -0,0 +1,178 @@
|
|||
name: Build
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
# Cache
|
||||
- name: Cache .gradle/caches
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
|
||||
restore-keys: ${{ runner.os }}-gradle-cache-
|
||||
- name: Cache .gradle/wrapper
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
|
||||
restore-keys: ${{ runner.os }}-gradle-wrapper-
|
||||
# Licensing
|
||||
- name: Licensing
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
with:
|
||||
arguments: --console=plain -S license
|
||||
# Coding style
|
||||
- name: Coding style
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
with:
|
||||
arguments: --console=plain -i codenarcMain codenarcTest codenarcIntTest
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
# use a short path to avoid exceeding the path limit on Windows... sigh
|
||||
with:
|
||||
path: 'w'
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
# Cache
|
||||
- name: Cache .gradle/caches
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
|
||||
restore-keys: ${{ runner.os }}-gradle-cache-
|
||||
- name: Cache .gradle/wrapper
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
|
||||
restore-keys: ${{ runner.os }}-gradle-wrapper-
|
||||
# Build
|
||||
- name: Build
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
with:
|
||||
arguments: --console=plain --warning-mode=all clean assemble
|
||||
# Test
|
||||
- name: UnitTest
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
with:
|
||||
arguments: --console=plain --warning-mode=all --no-parallel test
|
||||
# Test
|
||||
- name: IntegrationTest
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
with:
|
||||
arguments: --console=plain --warning-mode=all --no-parallel intTest
|
||||
# Test
|
||||
- name: CompatibilityTest
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
with:
|
||||
arguments: --console=plain --warning-mode=all --no-parallel gradleTest
|
||||
# Stop gradlew to avoid locking issues
|
||||
- name: Cleanup
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
with:
|
||||
arguments: --stop
|
||||
- name: Store reports
|
||||
uses: actions/upload-artifact@v2
|
||||
if: always()
|
||||
with:
|
||||
name: Test reports Windows
|
||||
path: "**/build/reports/**"
|
||||
retention-days: 5
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
java: [ 8, 11 ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
# Cache
|
||||
- name: Cache .gradle/caches
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
|
||||
restore-keys: ${{ runner.os }}-gradle-cache-
|
||||
- name: Cache .gradle/wrapper
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
|
||||
restore-keys: ${{ runner.os }}-gradle-wrapper-
|
||||
# Build
|
||||
- name: Build
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
with:
|
||||
arguments: -i -S --console=plain --no-build-cache assemble validateTaskProperties
|
||||
# Unit tests
|
||||
- name: Unit tests
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
with:
|
||||
arguments: -i -s --console=plain --no-build-cache test
|
||||
# Integration tests
|
||||
- name: Integration tests
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
with:
|
||||
arguments: -i -s --console=plain --no-build-cache intTest
|
||||
# Gradle tests
|
||||
- name: Compatibility tests
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
with:
|
||||
arguments: -i -s --console=plain --no-build-cache gradleTest
|
||||
- name: Store reports
|
||||
uses: actions/upload-artifact@v2
|
||||
if: always()
|
||||
with:
|
||||
name: Test reports
|
||||
path: "**/build/reports/**"
|
||||
retention-days: 5
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
# on:
|
||||
# push:
|
||||
# branches:
|
||||
# - release
|
||||
needs: build
|
||||
if: ${{ github.repository == 'jruby-gradle/jruby-gradle-plugin' && github.ref == 'refs/heads/release' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 8
|
||||
- name: Cache .gradle/caches
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
|
||||
restore-keys: ${{ runner.os }}-gradle-cache-
|
||||
- name: Cache .gradle/wrapper
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
|
||||
restore-keys: ${{ runner.os }}-gradle-wrapper-
|
||||
- name: Publish to Gradle Portal
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
env:
|
||||
PUBLISH_KEY: ${{ secrets.PUBLISH_KEY }}
|
||||
PUBLISH_SECRET: ${{ secrets.PUBLISH_SECRET }}
|
||||
with:
|
||||
arguments: -i --console=plain --no-build-cache assemble publishPlugins -Dgradle.publish.key=$PUBLISH_KEY -Dgradle.publish.secret=$PUBLISH_SECRET
|
||||
- name: Publish documentation
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
env:
|
||||
GH_PAGES_PUSH_USER: ${{ secrets.GH_PAGES_PUSH_USER }}
|
||||
GH_PAGES_PUSH_TOKEN: ${{ secrets.GH_PAGES_PUSH_TOKEN }}
|
||||
with:
|
||||
arguments: -i --console=plain --no-build-cache docs:publishGhPages -Dorg.ajoberstar.grgit.auth.username=$GH_PAGES_PUSH_USER -Dorg.ajoberstar.grgit.auth.password=$GH_PAGES_PUSH_TOKEN -Dorg.ajoberstar.grgit.auth.force=hardcoded
|
|
@ -0,0 +1,7 @@
|
|||
# Enable auto-env through the sdkman_auto_env config
|
||||
# Add key=value pairs of SDKs to use below
|
||||
<<<<<<< HEAD
|
||||
java=8.0.265.j9-adpt
|
||||
=======
|
||||
java=8.0.282.hs-adpt
|
||||
>>>>>>> 998cb79 (Add sdkmanrc file and set to use JDK8)
|
14
.travis.yml
14
.travis.yml
|
@ -1,14 +0,0 @@
|
|||
language: java
|
||||
sudo: true
|
||||
#env:
|
||||
# - GRADLE_OPTS="-Xmx768m -Xms256m -Xss1m"
|
||||
script:
|
||||
- ./gradlew -S -i --max-workers=2 --no-daemon clean check build --scan
|
||||
jdk:
|
||||
- openjdk8
|
||||
- openjdk11
|
||||
os:
|
||||
- linux
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.gradle
|
24
appveyor.yml
24
appveyor.yml
|
@ -1,24 +0,0 @@
|
|||
version: "{branch} {build}"
|
||||
|
||||
build:
|
||||
verbosity: detailed
|
||||
|
||||
build_script:
|
||||
- gradlew.bat assemble --info --no-daemon --scan
|
||||
|
||||
test_script:
|
||||
- gradlew.bat test check gradleTest --info --no-daemon --scan
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- development
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- JAVA_HOME: C:\Program Files\Java\jdk1.8.0
|
||||
- JAVA_HOME: C:\Program Files (x86)\Java\jdk1.8.0
|
||||
|
||||
|
||||
cache:
|
||||
- C:\Users\appveyor\.gradle
|
|
@ -102,47 +102,17 @@ task installGroovyDoc(type: Copy) {
|
|||
onlyIf { project.hasProperty('jrubyGradleWebsiteInstallDir') }
|
||||
}
|
||||
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
// groupId project.group
|
||||
// artifactId project.archivesBaseName
|
||||
// version project.version
|
||||
|
||||
artifact sourcesJar {
|
||||
classifier "sources"
|
||||
}
|
||||
|
||||
from components.java
|
||||
pluginBundle {
|
||||
plugins {
|
||||
gradlePlugin {
|
||||
id = 'com.github.jruby-gradle.base'
|
||||
displayName = 'JRuby/Gradle base plugin'
|
||||
description = 'The purpose of plugin is to encapsulate useful Gradle functionality for JRuby projects'
|
||||
tags = (['jruby'])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bintray {
|
||||
user = project.bintrayUser
|
||||
key = project.bintrayKey
|
||||
publish = true
|
||||
dryRun = false
|
||||
publications = ['maven']
|
||||
|
||||
pkg {
|
||||
userOrg = 'jruby-gradle'
|
||||
repo = 'plugins'
|
||||
name = 'jruby-gradle-plugin'
|
||||
labels = ['jruby']
|
||||
|
||||
version {
|
||||
name = project.version
|
||||
vcsTag = "v${project.version}"
|
||||
attributes = ['gradle-plugin': 'com.github.jruby-gradle.base:com.github.jruby-gradle:jruby-gradle-plugin']
|
||||
desc = 'The purpose of plugin is to encapsulate useful Gradle functionality for JRuby projects.'
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
bintrayUpload.dependsOn assemble
|
||||
|
||||
gradleTest.mustRunAfter integrationTest
|
||||
// vim: ft=groovy
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import spock.lang.IgnoreIf
|
|||
/**
|
||||
* @author Schalk W. Cronjé
|
||||
*/
|
||||
@IgnoreIf({System.getProperty('TESTS_ARE_OFFLINE')})
|
||||
@IgnoreIf({ System.getProperty('TESTS_ARE_OFFLINE') })
|
||||
class JRubyExecExtensionIntegrationSpec extends IntegrationSpecification {
|
||||
|
||||
public static final String DEFAULT_TASK_NAME = 'inlineJRubyExec'
|
||||
|
|
|
@ -25,11 +25,7 @@ package com.github.jrubygradle
|
|||
|
||||
import com.github.jrubygradle.testhelper.IntegrationSpecification
|
||||
import org.gradle.testkit.runner.BuildResult
|
||||
import spock.lang.IgnoreIf
|
||||
import spock.lang.Issue
|
||||
import spock.lang.PendingFeature
|
||||
|
||||
import static com.github.jrubygradle.internal.JRubyExecUtils.DEFAULT_JRUBYEXEC_CONFIG
|
||||
|
||||
class JRubyExecIntegrationSpec extends IntegrationSpecification {
|
||||
static final String DEFAULT_TASK_NAME = 'RubyWax'
|
||||
|
@ -151,9 +147,9 @@ class JRubyExecIntegrationSpec extends IntegrationSpecification {
|
|||
script 'rspec'
|
||||
"""
|
||||
|
||||
File specDir = new File(projectDir,'spec')
|
||||
File specDir = new File(projectDir, 'spec')
|
||||
specDir.mkdirs()
|
||||
new File(specDir,'sample.rb').text = ''
|
||||
new File(specDir, 'sample.rb').text = ''
|
||||
|
||||
when:
|
||||
BuildResult result = build()
|
||||
|
|
|
@ -30,7 +30,7 @@ import spock.lang.IgnoreIf
|
|||
/**
|
||||
* @author Schalk W. Cronjé
|
||||
*/
|
||||
@IgnoreIf({System.getProperty('TESTS_ARE_OFFLINE')})
|
||||
@IgnoreIf({ System.getProperty('TESTS_ARE_OFFLINE') })
|
||||
class JRubyGenerateGradleRbIntegrationSpec extends IntegrationSpecification {
|
||||
|
||||
static final String DEFAULT_TASK_NAME = 'RubyWax'
|
||||
|
|
|
@ -106,7 +106,6 @@ class JRubyPrepareGemsIntegrationSpec extends IntegrationSpecification {
|
|||
lockAllConfigurations()
|
||||
}
|
||||
|
||||
|
||||
"""
|
||||
withDependencies """
|
||||
gems "rubygems:sinatra:1.4.5"
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
*/
|
||||
package com.github.jrubygradle.testhelper
|
||||
|
||||
|
||||
import org.gradle.testkit.runner.GradleRunner
|
||||
import org.junit.Rule
|
||||
import org.junit.rules.TemporaryFolder
|
||||
|
@ -55,7 +54,7 @@ class IntegrationSpecification extends Specification {
|
|||
Map artifactVersions
|
||||
|
||||
@Rule
|
||||
TemporaryFolder testFolder
|
||||
TemporaryFolder testFolder = new TemporaryFolder(new File(System.getProperty('TMP_FOLDER')))
|
||||
|
||||
File projectDir
|
||||
File buildFile
|
||||
|
@ -65,6 +64,7 @@ class IntegrationSpecification extends Specification {
|
|||
testProperties = loadTestProperties()
|
||||
flatRepoLocation = new File(testProperties.flatrepo)
|
||||
mavenRepoLocation = new File(testProperties.mavenrepo)
|
||||
new File(System.getProperty('TMP_FOLDER')).mkdirs()
|
||||
|
||||
artifactVersions = [
|
||||
'credit_card_validator': testProperties.creditCardValidatorVersion,
|
||||
|
@ -77,7 +77,7 @@ class IntegrationSpecification extends Specification {
|
|||
}
|
||||
|
||||
void setup() {
|
||||
projectDir = testFolder.root
|
||||
projectDir = testFolder.root.absoluteFile
|
||||
buildFile = new File(projectDir, 'build.gradle')
|
||||
settingsFile = new File(projectDir, 'settings.gradle')
|
||||
|
||||
|
@ -90,7 +90,7 @@ class IntegrationSpecification extends Specification {
|
|||
destination.text = this.class.getResource("/scripts/${name}").text
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings('ThrowRuntimeException')
|
||||
String findDependency(final String organisation, final String artifact, final String extension) {
|
||||
String ver = artifactVersions[artifact]
|
||||
if (!ver) {
|
||||
|
|
|
@ -32,12 +32,9 @@ import org.gradle.api.artifacts.Configuration
|
|||
import org.gradle.api.model.ReplacedBy
|
||||
import org.gradle.api.provider.Provider
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.InputFile
|
||||
import org.gradle.api.tasks.Internal
|
||||
import org.gradle.api.tasks.JavaExec
|
||||
import org.gradle.api.tasks.LocalState
|
||||
import org.gradle.api.tasks.Optional
|
||||
import org.gradle.api.tasks.PathSensitive
|
||||
import org.gradle.api.tasks.PathSensitivity
|
||||
import org.gradle.api.tasks.TaskContainer
|
||||
import org.gradle.process.JavaExecSpec
|
||||
import org.gradle.util.GradleVersion
|
||||
|
@ -75,6 +72,16 @@ class JRubyExec extends JavaExec implements JRubyAwareTask, JRubyExecSpec {
|
|||
this.jruby = extensions.create(JRubyPluginExtension.NAME, JRubyPluginExtension, this)
|
||||
this.projectOperations = ProjectOperations.create(project)
|
||||
this.tasks = project.tasks
|
||||
this.inputs.property 'script-path', { scr ->
|
||||
File f = resolveScript(projectOperations, scr)
|
||||
if (!f) {
|
||||
''
|
||||
} else if (f.exists()) {
|
||||
f.text
|
||||
} else {
|
||||
stringize(scr)
|
||||
}
|
||||
}.curry(this.script)
|
||||
|
||||
inputs.property 'jrubyver', { JRubyPluginExtension jruby ->
|
||||
jruby.jrubyVersion
|
||||
|
@ -104,9 +111,10 @@ class JRubyExec extends JavaExec implements JRubyAwareTask, JRubyExecSpec {
|
|||
/** Script to execute.
|
||||
* @return The path to the script (or {@code null} if not set)
|
||||
*/
|
||||
@Optional
|
||||
@InputFile
|
||||
@PathSensitive(PathSensitivity.NONE)
|
||||
// @Optional
|
||||
// @InputFile
|
||||
// @PathSensitive(PathSensitivity.NONE)
|
||||
@Internal
|
||||
File getScript() {
|
||||
resolveScript(projectOperations, this.script)
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
*/
|
||||
package com.github.jrubygradle
|
||||
|
||||
|
||||
import org.gradle.api.InvalidUserDataException
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.artifacts.Configuration
|
||||
|
@ -80,7 +79,7 @@ class JRubyExecTaskSpec extends Specification {
|
|||
execTask.jruby.jrubyVersion != project.jruby.jrubyVersion
|
||||
|
||||
and: "jrubyConfigurationName must point to this new configuration"
|
||||
execTask.jruby.getGemConfiguration().name == configurationName
|
||||
execTask.jruby.gemConfiguration.name == configurationName
|
||||
|
||||
and: "configuration must exist"
|
||||
project.configurations.findByName(configurationName)
|
||||
|
@ -178,6 +177,6 @@ class JRubyExecTaskSpec extends Specification {
|
|||
}
|
||||
|
||||
then:
|
||||
execTask.jruby.getGemConfiguration().name == customConfig.name
|
||||
execTask.jruby.gemConfiguration.name == customConfig.name
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
package com.github.jrubygradle
|
||||
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.artifacts.repositories.ArtifactRepository
|
||||
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
|
||||
import org.gradle.testfixtures.ProjectBuilder
|
||||
import spock.lang.Specification
|
||||
|
||||
|
@ -45,12 +43,4 @@ class JRubyPluginSpec extends Specification {
|
|||
then:
|
||||
project.jruby.defaultVersion == JRubyPluginExtension.DEFAULT_JRUBY_VERSION
|
||||
}
|
||||
|
||||
private Collection hasRepositoryUrl(Project p, String url) {
|
||||
p.repositories.findAll { ArtifactRepository r ->
|
||||
r instanceof IvyArtifactRepository
|
||||
}.findAll {
|
||||
it.ivyPattern.contains(url)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ class JRubyExecUtilsSpec extends Specification {
|
|||
|
||||
void "Prepare a basic JRuby environment"() {
|
||||
when:
|
||||
Map preparedEnv = prepareJRubyEnvironment([:],false, new File('tmp/foo'))
|
||||
Map preparedEnv = prepareJRubyEnvironment([:], false, new File('tmp/foo'))
|
||||
|
||||
then:
|
||||
preparedEnv.size() > 0
|
||||
|
@ -128,7 +128,7 @@ class JRubyExecUtilsSpec extends Specification {
|
|||
'GEM_HOME' : '/tmp/spock',
|
||||
'RUBY_VERSION' : 'notaversion',
|
||||
'rvm_ruby_string': 'jruby-head',
|
||||
],false, gemWorkDir)
|
||||
], false, gemWorkDir)
|
||||
|
||||
then:
|
||||
preparedEnv['GEM_HOME'] == gemWorkDir.absolutePath
|
||||
|
|
14
build.gradle
14
build.gradle
|
@ -1,11 +1,10 @@
|
|||
plugins {
|
||||
id 'com.gradle.build-scan' version '2.0.2'
|
||||
id 'org.ysb33r.gradletest' version '2.0-rc.4' apply false
|
||||
id 'com.jfrog.bintray' version '1.8.4' apply false
|
||||
id 'org.ajoberstar.github-pages' version '1.2.0' apply false
|
||||
id 'org.ysb33r.cloudci.appveyor.testreporter' version '2.5' apply false
|
||||
id 'com.github.hierynomus.license' version '0.14.0' apply false
|
||||
id 'io.ratpack.ratpack-java' version "1.6.1" apply false
|
||||
id 'com.gradle.plugin-publish' version '0.14.0' apply false
|
||||
}
|
||||
|
||||
buildScan {
|
||||
|
@ -33,10 +32,9 @@ allprojects {
|
|||
}
|
||||
|
||||
subprojects {
|
||||
apply plugin: 'maven'
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
|
||||
if (project.name != 'docs') {
|
||||
|
@ -44,10 +42,8 @@ subprojects {
|
|||
apply plugin: 'java-gradle-plugin'
|
||||
apply plugin: 'groovy'
|
||||
apply plugin: 'codenarc'
|
||||
apply plugin: 'com.jfrog.bintray'
|
||||
apply plugin: 'org.ysb33r.gradletest'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'org.ysb33r.cloudci.appveyor.testreporter'
|
||||
apply plugin: 'com.gradle.plugin-publish'
|
||||
apply from: "${rootProject.projectDir}/gradle/integration-tests.gradle"
|
||||
apply from: "${rootProject.projectDir}/gradle/license.gradle"
|
||||
|
||||
|
@ -92,8 +88,6 @@ subprojects {
|
|||
dependsOn jar
|
||||
}
|
||||
|
||||
install.dependsOn check
|
||||
|
||||
tasks.withType(Test) {
|
||||
if (gradle.startParameter.isOffline()) {
|
||||
systemProperties 'TESTS_ARE_OFFLINE': '1'
|
||||
|
|
|
@ -18,33 +18,19 @@ artifacts {
|
|||
archives sourcesJar
|
||||
}
|
||||
|
||||
bintray {
|
||||
user = project.bintrayUser
|
||||
key = project.bintrayKey
|
||||
publish = true
|
||||
dryRun = false
|
||||
configurations = ['archives']
|
||||
|
||||
pkg {
|
||||
userOrg = 'jruby-gradle'
|
||||
repo = 'plugins'
|
||||
name = 'jruby-gradle-core-plugin'
|
||||
labels = ['jruby']
|
||||
|
||||
version {
|
||||
name = project.version
|
||||
vcsTag = "v${project.version}"
|
||||
attributes = ['gradle-plugin': 'com.github.jruby-gradle.core:com.github.jruby-gradle:jruby-gradle-core-plugin']
|
||||
desc = 'This plugin provides some core dependency resolution for JRuby/Gradle'
|
||||
pluginBundle {
|
||||
plugins {
|
||||
gradlePlugin {
|
||||
id = 'com.github.jruby-gradle.core'
|
||||
displayName = 'JRuby/Gradle core plugin'
|
||||
description = 'This plugin provides some core dependency resolution for JRuby/Gradle'
|
||||
tags = (['jruby'])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
processResources {
|
||||
filesMatching '**/com.jrubygradle.core-plugin.version.properties', {
|
||||
expand VERSION : project.version
|
||||
}
|
||||
}
|
||||
|
||||
bintrayUpload.dependsOn assemble
|
||||
|
|
|
@ -30,7 +30,6 @@ import org.junit.rules.TemporaryFolder
|
|||
import spock.lang.IgnoreIf
|
||||
import spock.lang.Issue
|
||||
import spock.lang.Specification
|
||||
import spock.lang.Unroll
|
||||
|
||||
import java.util.regex.Pattern
|
||||
|
||||
|
@ -104,7 +103,6 @@ class IvyXmlProxyServerIntegrationSpec extends Specification {
|
|||
new File(projectDir, 'build/something/base_app-1.0.6.gem').exists()
|
||||
}
|
||||
|
||||
|
||||
void 'Download Asciidoctor Reveal.JS GEM and friends'() {
|
||||
setup:
|
||||
withBuildFile '''
|
||||
|
|
|
@ -61,6 +61,6 @@ class IvyXmlProxyServerSpec extends Specification {
|
|||
}
|
||||
|
||||
then: 'The Ivy file should be generated and cached locally'
|
||||
new File(projectRoot.root,TEST_IVY_PATH)
|
||||
new File(projectRoot.root, TEST_IVY_PATH)
|
||||
}
|
||||
}
|
|
@ -27,7 +27,6 @@ import org.gradle.api.Project
|
|||
import org.gradle.testfixtures.ProjectBuilder
|
||||
import spock.lang.Specification
|
||||
|
||||
|
||||
class RepositoryHandlerExtensionSpec extends Specification {
|
||||
|
||||
Project project = ProjectBuilder.builder().build()
|
||||
|
@ -35,13 +34,13 @@ class RepositoryHandlerExtensionSpec extends Specification {
|
|||
void 'Add Maven repository'() {
|
||||
when:
|
||||
project.allprojects {
|
||||
apply plugin : JRubyCorePlugin
|
||||
apply plugin: JRubyCorePlugin
|
||||
|
||||
repositories {
|
||||
ruby {
|
||||
mavengems()
|
||||
mavengems('https://goo1')
|
||||
mavengems('goo2','https://goo2')
|
||||
mavengems('goo2', 'https://goo2')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
*/
|
||||
package com.github.jrubygradle.api.gems
|
||||
|
||||
import com.github.jrubygradle.api.gems.GemOverwriteAction
|
||||
import com.github.jrubygradle.api.gems.GemUtils
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.file.DuplicateFileCopyingException
|
||||
import org.gradle.testfixtures.ProjectBuilder
|
||||
|
|
|
@ -35,7 +35,7 @@ class GemVersionSpec extends Specification {
|
|||
@Unroll
|
||||
void "#gemRequirement (gem requirement) ⇒ #ivyNotation (ivy)"() {
|
||||
when:
|
||||
String ivy = gemVersionFromGemRequirement(gemRequirement).toString()
|
||||
String ivy = gemVersionFromGemRequirement(gemRequirement)
|
||||
|
||||
then:
|
||||
ivy == ivyNotation
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
*/
|
||||
package com.github.jrubygradle.internal.gems
|
||||
|
||||
|
||||
import spock.lang.Specification
|
||||
|
||||
class GemToIvySpec extends Specification {
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
url "https://plugins.gradle.org/m2/"
|
||||
}
|
||||
gradlePluginPortal()
|
||||
}
|
||||
dependencies {
|
||||
/* wow. so recursion */
|
||||
|
@ -30,7 +28,7 @@ dependencies {
|
|||
}
|
||||
|
||||
task prepareGroovyDocs(type: Copy) {
|
||||
description "Copy Groovydocs into our site directory for deploybment/publication"
|
||||
description "Copy Groovydocs into our site directory for deployment/publication"
|
||||
into "${buildDir}/_site/groovydoc"
|
||||
|
||||
rootProject.subprojects.each {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
version=2.1.0-alpha.2
|
||||
version=2.1.0-alpha.3
|
||||
group=com.github.jruby-gradle
|
||||
copyrightYear=2014-2020
|
||||
|
||||
|
@ -14,7 +14,7 @@ releaseBuild=false
|
|||
targetCompatibility=1.8
|
||||
sourceCompatibility=1.8
|
||||
|
||||
grolifantVersion=1.0.0-alpha.4
|
||||
grolifantVersion=1.0.0-alpha.6
|
||||
jrubyVersion=9.2.9.0
|
||||
jettyVersion=9.2.12.v20150709
|
||||
bcprovVersion=1.46
|
||||
|
|
|
@ -40,5 +40,6 @@ task integrationTest(type: Test, dependsOn: jar) {
|
|||
classpath = sourceSets.integrationTest.runtimeClasspath
|
||||
dependsOn copyIntegrationTestGems
|
||||
mustRunAfter test
|
||||
systemProperties TMP_FOLDER : file('build/tmp/integrationTestTempFolder').absolutePath
|
||||
}
|
||||
check.dependsOn integrationTest
|
||||
|
|
|
@ -20,7 +20,7 @@ dependencies {
|
|||
/*
|
||||
* NOTE: version 5.0.0 of the shadow plugin supports only Gradle 5.x and later
|
||||
*/
|
||||
compile 'com.github.jengelman.gradle.plugins:shadow:4.0.4'
|
||||
compile 'com.github.jengelman.gradle.plugins:shadow:5.2.0'
|
||||
compile 'org.codehaus.plexus:plexus-utils:[3.2.0,3.3)'
|
||||
compile 'org.apache.commons:commons-io:1.3.2'
|
||||
compile 'org.ow2.asm:asm-commons:[6.1,6.99)'
|
||||
|
@ -87,36 +87,21 @@ artifacts {
|
|||
archives sourcesJar
|
||||
}
|
||||
|
||||
bintray {
|
||||
user = project.bintrayUser
|
||||
key = project.bintrayKey
|
||||
publish = true
|
||||
dryRun = false
|
||||
configurations = ['archives']
|
||||
|
||||
pkg {
|
||||
userOrg = 'jruby-gradle'
|
||||
repo = 'plugins'
|
||||
name = 'jruby-gradle-jar-plugin'
|
||||
labels = ['jruby']
|
||||
|
||||
version {
|
||||
name = project.version
|
||||
vcsTag = "v${project.version}"
|
||||
attributes = ['gradle-plugin' : 'com.github.jruby-gradle.jar:com.github.jruby-gradle:jruby-gradle-jar-plugin']
|
||||
desc = 'This plugin encapsulates java archive building functionality for JRuby Gradle projects'
|
||||
|
||||
pluginBundle {
|
||||
plugins {
|
||||
gradlePlugin {
|
||||
id = 'com.github.jruby-gradle.jar'
|
||||
displayName = 'JRuby/Gradle base plugin'
|
||||
description = 'This plugin encapsulates java archive building functionality for JRuby Gradle projects'
|
||||
tags = (['jruby','fatjar'])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bintrayUpload {
|
||||
dependsOn assemble
|
||||
}
|
||||
|
||||
gradleTest {
|
||||
dependsOn jar
|
||||
mustRunAfter test, integrationTest
|
||||
enabled = false // TODO: Fix jar plugin as it has a DoS in jar construction.
|
||||
}
|
||||
|
||||
integrationTest {
|
||||
|
|
|
@ -26,7 +26,7 @@ package com.github.jrubygradle.jar
|
|||
import com.github.jrubygradle.jar.helpers.IntegrationSpecification
|
||||
import org.gradle.testkit.runner.BuildResult
|
||||
import org.gradle.testkit.runner.TaskOutcome
|
||||
import spock.lang.IgnoreIf
|
||||
import spock.lang.Ignore
|
||||
import spock.lang.Issue
|
||||
|
||||
import java.util.zip.ZipEntry
|
||||
|
@ -34,6 +34,7 @@ import java.util.zip.ZipFile
|
|||
|
||||
import static com.github.jrubygradle.jar.JRubyJar.DEFAULT_MAIN_CLASS
|
||||
|
||||
@Ignore
|
||||
class JRubyJarTestKitSpec extends IntegrationSpecification {
|
||||
|
||||
public static final String DEFAULT_TASK_NAME = 'jrubyJar'
|
||||
|
@ -173,23 +174,7 @@ class JRubyJarTestKitSpec extends IntegrationSpecification {
|
|||
"""
|
||||
}
|
||||
|
||||
private void withRepoSetup(String content) {
|
||||
this.repoSetup = """
|
||||
repositories {
|
||||
${content}
|
||||
}
|
||||
"""
|
||||
}
|
||||
|
||||
private void withDependencies(String content) {
|
||||
this.deps = """
|
||||
dependencies {
|
||||
${content}
|
||||
}
|
||||
"""
|
||||
}
|
||||
|
||||
private void withPreamble(String content) {
|
||||
private void withPreamble(String content) {
|
||||
this.preamble = content
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ import spock.lang.Specification
|
|||
|
||||
class IntegrationSpecification extends Specification {
|
||||
static final boolean OFFLINE = System.getProperty('TESTS_ARE_OFFLINE')
|
||||
static final File PARENT_TEST_FOLDER = new File(System.getProperty('TEST_TEMP_FOLDER', './build/tmp/integrationTests'))
|
||||
|
||||
@Shared
|
||||
Map testProperties
|
||||
|
@ -40,13 +41,14 @@ class IntegrationSpecification extends Specification {
|
|||
File mavenRepoLocation
|
||||
|
||||
@Rule
|
||||
TemporaryFolder testFolder
|
||||
TemporaryFolder testFolder = new TemporaryFolder(PARENT_TEST_FOLDER)
|
||||
|
||||
File projectDir
|
||||
File buildFile
|
||||
File settingsFile
|
||||
|
||||
void setupSpec() {
|
||||
PARENT_TEST_FOLDER.mkdirs()
|
||||
testProperties = loadTestProperties()
|
||||
flatRepoLocation = new File(testProperties.flatrepo)
|
||||
mavenRepoLocation = new File(testProperties.mavenrepo)
|
||||
|
@ -62,11 +64,12 @@ class IntegrationSpecification extends Specification {
|
|||
|
||||
GradleRunner gradleRunner(List<String> args) {
|
||||
GradleRunner.create()
|
||||
.withProjectDir(projectDir)
|
||||
.withDebug(true)
|
||||
.withArguments(args)
|
||||
.withPluginClasspath()
|
||||
.forwardOutput()
|
||||
.withProjectDir(projectDir)
|
||||
.withDebug(true)
|
||||
.withArguments(args)
|
||||
.withPluginClasspath()
|
||||
.withTestKitDir(PARENT_TEST_FOLDER)
|
||||
.forwardOutput()
|
||||
}
|
||||
|
||||
String pathAsUriStr(final File path) {
|
||||
|
|
|
@ -5,8 +5,8 @@ dependencies {
|
|||
compile project(':jruby-gradle-plugin')
|
||||
compile group: 'com.github.jruby-gradle', name: 'warbler-bootstrap', version: '0.2.0+'
|
||||
|
||||
testCompile (spockVersion) {
|
||||
exclude module : 'groovy-all'
|
||||
testCompile(spockVersion) {
|
||||
exclude module: 'groovy-all'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,27 +14,15 @@ artifacts {
|
|||
archives sourcesJar
|
||||
}
|
||||
|
||||
bintray {
|
||||
user = project.bintrayUser
|
||||
key = project.bintrayKey
|
||||
publish = true
|
||||
dryRun = false
|
||||
configurations = ['archives']
|
||||
|
||||
pkg {
|
||||
userOrg = 'jruby-gradle'
|
||||
repo = 'plugins'
|
||||
name = 'jruby-gradle-war-plugin'
|
||||
labels = ['jruby','war','java']
|
||||
|
||||
version {
|
||||
name = project.version
|
||||
vcsTag = "v${project.version}"
|
||||
attributes = ['gradle-plugin' : 'com.github.jruby-gradle.war:com.github.jruby-gradle:jruby-gradle-war-plugin']
|
||||
desc = project.description
|
||||
pluginBundle {
|
||||
plugins {
|
||||
gradlePlugin {
|
||||
id = 'com.github.jruby-gradle.jar'
|
||||
displayName = 'JRuby/Gradle base plugin'
|
||||
description = 'This plugin encapsulates building deployable WARs using JRuby'
|
||||
tags = (['jruby', 'war'])
|
||||
}
|
||||
}
|
||||
}
|
||||
bintrayUpload.dependsOn assemble
|
||||
|
||||
// vim: ft=groovy
|
||||
|
|
Loading…
Reference in New Issue