-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into refactor/generator-cli/file-read
- Loading branch information
Showing
47 changed files
with
10,686 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/gradlew text eol=lf | ||
*.bat text eol=crlf | ||
*.jar binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
node_modules | ||
HELP.md | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Kotlin ### | ||
.kotlin |
136 changes: 136 additions & 0 deletions
136
packages/java/tests/gradle/kotlin-gradle-test/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' version '1.9.25' | ||
id 'org.jetbrains.kotlin.plugin.spring' version '1.9.25' | ||
id 'org.jetbrains.kotlin.plugin.jpa' version '1.9.25' | ||
id 'org.springframework.boot' version '3.4.1' | ||
id 'io.spring.dependency-management' version '1.1.7' | ||
} | ||
|
||
apply plugin: 'com.vaadin.hilla' | ||
|
||
group = 'com.vaadin.hilla.gradle.test' | ||
|
||
dependencyManagement { | ||
imports { | ||
mavenBom "com.vaadin:hilla-bom:$hillaVersion" | ||
mavenBom "com.vaadin:flow-bom:$flowVersion" | ||
} | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
maven { setUrl("https://maven.vaadin.com/vaadin-prereleases") } | ||
maven { setUrl("https://maven.vaadin.com/vaadin-addons") } | ||
} | ||
|
||
dependencies { | ||
implementation 'com.vaadin:vaadin-spring' | ||
implementation 'com.vaadin:hilla' | ||
implementation "com.vaadin:vaadin-lumo-theme:$vaadinComponentsVersion" | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.parttio:line-awesome:1.1.0' | ||
implementation 'com.vaadin:vaadin-dev-server' | ||
runtimeOnly 'jakarta.servlet:jakarta.servlet-api:6.0.0' | ||
|
||
implementation 'org.jetbrains.kotlin:kotlin-reflect' | ||
implementation 'org.jetbrains.kotlin:kotlin-stdlib' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'com.h2database:h2' | ||
|
||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
|
||
testImplementation "com.vaadin:flow-test-util:$flowVersion" | ||
testImplementation "com.vaadin:vaadin-button-testbench:$vaadinComponentsVersion" | ||
testImplementation "com.vaadin:vaadin-text-field-testbench:$vaadinComponentsVersion" | ||
testImplementation "com.vaadin:vaadin-grid-testbench:$vaadinComponentsVersion" | ||
} | ||
|
||
sourceSets { | ||
main { | ||
java { | ||
srcDirs("src/main/kotlin") // Include the directory for package-info.java | ||
} | ||
kotlin { | ||
srcDirs("src/main/kotlin") | ||
} | ||
} | ||
test { | ||
kotlin { | ||
srcDirs("src/test/kotlin") | ||
} | ||
} | ||
} | ||
|
||
import java.util.concurrent.Executors | ||
import org.gradle.internal.os.OperatingSystem | ||
|
||
def isWindows = OperatingSystem.current().isWindows() | ||
|
||
tasks.register('productionBuild', Exec) { | ||
description = 'Builds the Spring Boot application for production.' | ||
def command | ||
if (isWindows) { | ||
command = ['cmd', '/c', 'gradlew.bat', 'clean', '-Pvaadin.productionMode', 'build', '-x', 'test'] | ||
} else { | ||
command = ['sh', '-c', './gradlew clean -Pvaadin.productionMode build -x test'] | ||
} | ||
commandLine command | ||
doLast { | ||
logger.info("Production build started...") | ||
} | ||
} | ||
|
||
tasks.register('bootStart') { | ||
description = 'Starts the Spring Boot application for integration tests.' | ||
dependsOn productionBuild | ||
doLast { | ||
logger.info("Running the application in production for integration tests...") | ||
// Retrieve the jar task | ||
def bootJarTask = tasks.named('bootJar').get() | ||
// Get the path to the generated JAR file | ||
def bootJarFile = bootJarTask.archiveFile.get().asFile | ||
if (!bootJarFile.exists()) { | ||
throw new GradleException("The bootJar output file not found at: ${bootJarFile.absolutePath}") | ||
} | ||
def processBuilder = new ProcessBuilder('java', '-jar', bootJarFile.absolutePath) | ||
processBuilder.redirectErrorStream(true) | ||
def process = processBuilder.start() | ||
def executor = Executors.newSingleThreadExecutor() | ||
executor.submit { | ||
process.inputStream.eachLine { println it } | ||
} | ||
// Store the process for later termination: | ||
project.ext.applicationProcess = process | ||
// Wait enough for the application to start: | ||
sleep(10000) | ||
} | ||
} | ||
|
||
tasks.register('bootStop') { | ||
description = 'Stops the Spring Boot application after integration tests.' | ||
doLast { | ||
if (project.ext.has('applicationProcess')) { | ||
def process = project.ext.applicationProcess | ||
if (process && process.isAlive()) { | ||
logger.lifecycle("Stopping the application after running the integration test ...") | ||
process.destroy() | ||
process.waitFor() | ||
logger.lifecycle("Application stopped successfully.") | ||
} else { | ||
logger.lifecycle("Application process is not running.") | ||
} | ||
} else { | ||
logger.lifecycle("No application process found.") | ||
} | ||
} | ||
} | ||
|
||
tasks.register('integrationTest', Test) { | ||
description = 'Runs integration tests.' | ||
dependsOn bootStart | ||
finalizedBy bootStop | ||
testClassesDirs = sourceSets.test.output.classesDirs | ||
classpath = sourceSets.test.runtimeClasspath | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/java/tests/gradle/kotlin-gradle-test/gradle.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
org.gradle.daemon=false | ||
hillaVersion=24.7-SNAPSHOT | ||
flowVersion=24.7-SNAPSHOT | ||
vaadinComponentsVersion=24.7-SNAPSHOT |
Binary file added
BIN
+42.6 KB
packages/java/tests/gradle/kotlin-gradle-test/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions
7
packages/java/tests/gradle/kotlin-gradle-test/gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.