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

Update gradle to 6.0 and validate gradle wrapper #546

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "Validate Gradle Wrapper"
on: [push, pull_request]

jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ env:
- TEST_CATEGORY=fullCompileTests
- TEST_CATEGORY=runProjectTests
- TEST_CATEGORY=proxyTest
before_script:
- echo $JAVA_OPTS
- export JAVA_OPTS=-Xmx4G
script: "./gradlew --stacktrace check -PTEST_CATEGORY=$TEST_CATEGORY"
branches:
only:
Expand Down
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ sourceSets {
resources {
srcDir file('src/functionalTest/resources')
}
compileClasspath += sourceSets.main.output + configurations.testRuntime
compileClasspath += sourceSets.main.output + configurations.testRuntimeClasspath
runtimeClasspath += output + compileClasspath
}
}
Expand Down Expand Up @@ -129,7 +129,7 @@ idea {
* Compiles the tests
*/
compileFunctionalTestGroovy {
classpath += configurations.proxyTest
classpath += configurations.proxyTest + configurations.testRuntimeClasspath
}

/**
Expand All @@ -154,6 +154,7 @@ processResources {
])
}
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}


Expand Down Expand Up @@ -404,7 +405,7 @@ pluginBundle {
*
**********************************************************************************************************************/
wrapper {
gradleVersion = '5.6'
gradleVersion = '6.0'
distributionUrl = distributionUrl.replace('bin', 'all') // Download sources
}

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
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-5.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 12 additions & 17 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

Expand All @@ -175,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class GradleVersionTest extends IntegrationTest {

@Parameterized.Parameters(name = "Gradle {0}")
static Collection<String> getGradleVersions() {
[ '5.6']
[ '6.0']
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class KotlinTest extends KotlinIntegrationTest {

@Parameterized.Parameters(name = "Kotlin {0}")
static Collection<String> getKotlinVersions() {
[ '1.3.11']
[ '1.3.70']
}

@Test void 'Create project'() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class GradleVaadinPlugin implements Plugin<Project> {

Gradle gradle = project.gradle
VersionNumber version = VersionNumber.parse(gradle.gradleVersion)
VersionNumber requiredVersion = new VersionNumber(5, 6, 0, null)
VersionNumber requiredVersion = new VersionNumber(6, 0, 0, null)
if ( version.baseVersion < requiredVersion ) {
throw new UnsupportedVersionException("Your gradle version ($version) is too old. " +
"Plugin requires Gradle $requiredVersion+")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.devsoap.plugin.Util
import org.gradle.api.file.FileCollection
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.bundling.Jar

/**
Expand All @@ -32,6 +33,7 @@ class BuildClassPathJar extends Jar {

public static final String NAME = 'vaadinClassPathJar'

@Input
private final Property<Boolean> useClassPathJar = project.objects.property(Boolean)

BuildClassPathJar() {
Expand All @@ -51,7 +53,7 @@ class BuildClassPathJar extends Jar {
project.configurations[GradleVaadinPlugin.CONFIGURATION_RUN_SERVER] +
project.configurations[GradleVaadinPlugin.CONFIGURATION_THEME]
)
.filter { it.file && it.canonicalFile.name.endsWith('.jar')}
.filter { it.file && it.canonicalFile.name.endsWith('.jar') }
manifest {
it.attributes('Class-Path':files.collect { File file -> file.toURI().toString() }.join(' '))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.TaskAction
import org.gradle.tooling.BuildActionFailureException

Expand Down Expand Up @@ -65,10 +66,14 @@ class CompileThemeTask extends DefaultTask {

private static final String STYLES_SCSS = 'styles.scss'

@Input
@Optional
private final Property<String> themesDirectory = project.objects.property(String)
private final Property<String> compiler = project.objects.property(String)
private final Property<Boolean> compress = project.objects.property(Boolean)
@Input
private final Property<Boolean> useClasspathJar = project.objects.property(Boolean)
@Input
private final ListProperty<String> jvmArgs = project.objects.listProperty(String)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.TaskAction

import java.util.concurrent.TimeUnit
Expand All @@ -51,31 +53,61 @@ class CompileWidgetsetTask extends DefaultTask {

private static final WIDGETSET_CDN_URL = 'https://wsc.vaadin.com/'

@Input
private final Property<String> style = project.objects.property(String)
@Input
private final Property<Integer> optimize = project.objects.property(Integer)
@Input
private final Property<Boolean> logEnabled = project.objects.property(Boolean)
@Input
private final Property<String> logLevel = project.objects.property(String)
@Input
private final Property<Integer> localWorkers = project.objects.property(Integer)
@Input
private final Property<Boolean> draftCompile = project.objects.property(Boolean)
@Input
private final Property<Boolean> strict = project.objects.property(Boolean)
@Input
@Optional
private final Property<String> userAgent = project.objects.property(String)
@Input
private final ListProperty<String> jvmArgs = project.objects.listProperty(String)
@Input
private final ListProperty<String> extraArgs = project.objects.listProperty(String)
@Input
private final ListProperty<String> sourcePaths = project.objects.listProperty(String)
@Input
private final Property<Boolean> collapsePermutations = project.objects.property(Boolean)
@Input
private final ListProperty<String> extraInherits = project.objects.listProperty(String)
@Input
private final Property<Boolean> gwtSdkFirstInClasspath = project.objects.property(Boolean)
@Input
@Optional
private final Property<String> outputDirectory = project.objects.property(String)
@Input
private final Property<Boolean> widgetsetCDN = project.objects.property(Boolean)
@Input
private final Property<Boolean> profiler = project.objects.property(Boolean)
@Input
private final Property<Boolean> manageWidgetset = project.objects.property(Boolean)
@Input
@Optional
private final Property<String> widgetset = project.objects.property(String)
@Input
@Optional
private final Property<String> widgetsetGenerator = project.objects.property(String)

@Input
private final Property<Boolean> proxyEnabled = project.objects.property(Boolean)
@Input
private final Property<Integer> proxyPort = project.objects.property(Integer)
@Input
private final Property<String> proxyScheme = project.objects.property(String)
@Input
private final Property<String> proxyHost = project.objects.property(String)
@Input
@Optional
private final Property<AuthConfig> proxyAuth = project.objects.property(AuthConfig)

private Closure<Map> queryWidgetsetRequest = { version, style ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.devsoap.plugin.creators.ProjectCreator
import com.devsoap.plugin.creators.ThemeCreator
import com.devsoap.plugin.extensions.VaadinPluginExtension
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.options.Option
import org.gradle.api.tasks.TaskAction

Expand All @@ -46,6 +47,7 @@ class CreateAddonProjectTask extends DefaultTask {
/**
* The addon name
*/
@Input
@Option(option = 'name', description = 'Addon name')
String componentName = 'MyComponent'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ package com.devsoap.plugin.tasks

import com.devsoap.plugin.creators.AddonThemeCreator
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.options.Option
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
Expand All @@ -32,11 +34,14 @@ class CreateAddonThemeTask extends DefaultTask {

static final String NAME = 'vaadinCreateAddonTheme'

@Input
private final Property<String> addonTitle = project.objects.property(String)

/**
* The theme name
*/
@Input
@Optional
@Option(option = 'name', description = 'Theme name')
String themeName = 'MyAddonTheme'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package com.devsoap.plugin.tasks
import com.devsoap.plugin.Util
import com.devsoap.plugin.creators.ComponentCreator
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.options.Option
import org.gradle.api.tasks.TaskAction

Expand All @@ -34,6 +35,7 @@ class CreateComponentTask extends DefaultTask {
/**
* The component name
*/
@Input
@Option(option = 'name', description = 'Component name')
String componentName = 'MyComponent'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.devsoap.plugin.ProjectType
import com.devsoap.plugin.TemplateUtil
import com.devsoap.plugin.Util
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.options.Option
import org.gradle.api.tasks.TaskAction

Expand All @@ -37,12 +38,14 @@ class CreateCompositeTask extends DefaultTask {
/**
* The composite class name
*/
@Input
@Option(option = 'name', description = 'Component name')
String componentName = 'MyComposite'

/**
* The composite package name
*/
@Input
@Option(option = 'package', description = 'Package name')
String componentPackage = "com.example.${componentName.toLowerCase()}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.devsoap.plugin.TemplateUtil
import com.devsoap.plugin.Util
import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.options.Option
import org.gradle.api.tasks.TaskAction

Expand All @@ -42,37 +43,43 @@ class CreateDesignTask extends DefaultTask{
/**
* The design class name
*/
@Input
@Option(option = 'name', description = 'The name of the design')
String designName = 'BasicView'

/**
* The package where the design should be put
*/
@Input
@Option(option = 'package', description = 'The package of the design')
String designPackage = "com.example.${designName.toLowerCase()}"

/**
* Should a companion java file be created
*/
@Input
@Option(option = 'companionFile', description = 'Create the companion file for the design')
boolean createCompanionFile = true

/**
* Should a companion implementation file be created
*/
@Input
@Option(option = 'implementationFile', description = 'Create implementation file for the design')
boolean createImplementationFile = true

/**
* Should we output the templates available to the console instead of creating a design.
*/
@Input
@Option(option = 'templates', description =
'Lists the available templates. Add your templates to .vaadin/designer/templates to use them here.')
boolean listTemplates = false

/**
* The template to use for creating a design
*/
@Input
@Option(option = 'template', description = "The selected template to use. Must be included in --templates")
String template = null

Expand Down
Loading