Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert build.gradle to build.gradle.kts #2

Open
wants to merge 1 commit into
base: main
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

# Gradle
.gradle
gradle/
gradlew
gradlew.bat
build/

# Ignore Gradle GUI config
Expand Down
62 changes: 0 additions & 62 deletions jqwik-spring-boot-gradle/build.gradle

This file was deleted.

65 changes: 65 additions & 0 deletions jqwik-spring-boot-gradle/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
plugins {
// id ("org.springframework.boot") version "2.2.0.RELEASE"
// id ("org.springframework.boot") version "2.2.5.RELEASE"
// id ("org.springframework.boot") version "2.2.6.RELEASE"
id ("org.springframework.boot") version "2.3.0.RELEASE"
id ("io.spring.dependency-management") version "1.0.9.RELEASE"
id("java")
}

val jqwikSpringVersion: String by project
val assertJVersion: String by project
val junitJupiterVersion: String by project
val mockitoVersion: String by project

ext {
set("mockito.version", mockitoVersion)
set("assertj.version", assertJVersion)
set("junit-jupiter.version", junitJupiterVersion)
}


group = "my.example"
version = "0.0.1-SNAPSHOT"

repositories {
mavenCentral()
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks {
compileTestJava {
options.compilerArgs.add("-parameters")
options.encoding = "UTF-8"
}

test {
useJUnitPlatform()

// To allow other naming conventions
include ("**/*Properties.class")
include ("**/*Examples.class")
include ("**/*Test.class")
include ("**/*Tests.class")
}

wrapper {
description = "Generates gradlew[.bat] scripts"
gradleVersion = "6.6.1"
}
}

dependencies {
implementation ("org.springframework.boot:spring-boot-starter-web")

testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude (group="org.junit.vintage", module="junit-vintage-engine")
}

testImplementation("net.jqwik:jqwik-spring:${jqwikSpringVersion}")
}
6 changes: 6 additions & 0 deletions jqwik-spring-boot-gradle/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# suppress inspection "UnusedProperty" for whole file

junitJupiterVersion=5.6.2
assertJVersion=3.16.1
jqwikSpringVersion=0.7.0
mockitoVersion=3.3.3
50 changes: 0 additions & 50 deletions jqwik-starter-gradle/build.gradle

This file was deleted.

51 changes: 51 additions & 0 deletions jqwik-starter-gradle/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
plugins {
id("java")
}

val jqwikVersion: String by project
val assertJVersion: String by project
val junitJupiterVersion: String by project
val junitPlatformVersion: String by project

repositories {
mavenCentral()
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks {
compileTestJava {
options.compilerArgs.add("-parameters")
options.encoding = "UTF-8"
}

test {
useJUnitPlatform()

// To allow other naming conventions
include ("**/*Properties.class")
include ("**/*Examples.class")
include ("**/*Test.class")
include ("**/*Tests.class")
}

wrapper {
description = "Generates gradlew[.bat] scripts"
gradleVersion = "6.6.1"
}
}

dependencies {
testImplementation("net.jqwik:jqwik:${jqwikVersion}")

// Fluent assertions library. You can use any other assertions instead.
testImplementation("org.assertj:assertj-core:${assertJVersion}")

// To work around IntelliJ bug to not provide run test decorator
// https://youtrack.jetbrains.com/issue/IDEA-231482
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
}

6 changes: 6 additions & 0 deletions jqwik-starter-gradle/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# suppress inspection "UnusedProperty" for whole file

junitPlatformVersion=1.6.2
junitJupiterVersion=5.6.2
assertJVersion=3.16.1
jqwikVersion=1.3.4
Binary file modified jqwik-starter-gradle/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 4 additions & 3 deletions jqwik-starter-gradle/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Mon Jun 22 09:46:04 CEST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
# suppress inspection "UnusedProperty" for whole file

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion jqwik-starter-gradle/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
21 changes: 3 additions & 18 deletions jqwik-starter-gradle/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -64,29 +64,14 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down