-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12046 from glefloch/fix/11902
Handle gradle included-builds in quarkusDev task
- Loading branch information
Showing
15 changed files
with
212 additions
and
9 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
43 changes: 43 additions & 0 deletions
43
...on-tests/gradle/src/test/java/io/quarkus/gradle/devmode/MultiModuleIncludedBuildTest.java
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,43 @@ | ||
package io.quarkus.gradle.devmode; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
|
||
public class MultiModuleIncludedBuildTest extends QuarkusDevGradleTestBase { | ||
|
||
@Override | ||
protected String projectDirectoryName() { | ||
return "multi-module-included-build"; | ||
} | ||
|
||
@Override | ||
protected String[] buildArguments() { | ||
return new String[] { "clean", "--include-build", "../external-library", "quarkusDev" }; | ||
} | ||
|
||
@Override | ||
protected void testDevMode() throws Exception { | ||
assertThat(getHttpResponse("/hello")).contains("foo bar"); | ||
} | ||
|
||
@Override | ||
protected File getProjectDir() { | ||
File projectDir = super.getProjectDir(); | ||
final File appProjectProperties = new File(projectDir, "app/gradle.properties"); | ||
final File libProjectProperties = new File(projectDir, "external-library/gradle.properties"); | ||
final Path projectProperties = projectDir.toPath().resolve("gradle.properties"); | ||
|
||
try { | ||
Files.copy(projectProperties, appProjectProperties.toPath()); | ||
Files.copy(projectProperties, libProjectProperties.toPath()); | ||
} catch (IOException e) { | ||
throw new IllegalStateException("Unable to copy gradle.properties file", e); | ||
} | ||
this.projectDir = appProjectProperties.getParentFile(); | ||
return this.projectDir; | ||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
integration-tests/gradle/src/test/resources/multi-module-included-build/app/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,29 @@ | ||
plugins { | ||
id 'java' | ||
id 'io.quarkus' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
if (System.properties.containsKey('maven.repo.local')) { | ||
maven { | ||
url System.properties.get('maven.repo.local') | ||
} | ||
} else { | ||
mavenLocal() | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") | ||
implementation 'io.quarkus:quarkus-resteasy' | ||
implementation 'org.acme:external-library:1.0.0-SNAPSHOT' | ||
} | ||
|
||
group 'org.acme' | ||
version '1.0.0-SNAPSHOT' | ||
|
||
compileJava { | ||
options.encoding = 'UTF-8' | ||
options.compilerArgs << '-parameters' | ||
} |
12 changes: 12 additions & 0 deletions
12
integration-tests/gradle/src/test/resources/multi-module-included-build/app/settings.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,12 @@ | ||
pluginManagement { | ||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
plugins { | ||
id 'io.quarkus' version "${quarkusPluginVersion}" | ||
} | ||
} | ||
|
||
rootProject.name='app' |
22 changes: 22 additions & 0 deletions
22
...est/resources/multi-module-included-build/app/src/main/java/org/acme/ExampleResource.java
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,22 @@ | ||
package org.acme; | ||
|
||
import org.acme.lib.LibService; | ||
|
||
import javax.inject.Inject; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
@Path("/hello") | ||
public class ExampleResource { | ||
|
||
@Inject | ||
LibService libService; | ||
|
||
@GET | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String hello() { | ||
return "foo " + libService.bar(); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
.../test/resources/multi-module-included-build/app/src/main/resources/application.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,2 @@ | ||
# Configuration file | ||
# key = value |
29 changes: 29 additions & 0 deletions
29
...tests/gradle/src/test/resources/multi-module-included-build/external-library/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,29 @@ | ||
plugins { | ||
id 'java' | ||
id 'io.quarkus' | ||
id "org.kordamp.gradle.jandex" version '0.6.0' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
if (System.properties.containsKey('maven.repo.local')) { | ||
maven { | ||
url System.properties.get('maven.repo.local') | ||
} | ||
} else { | ||
mavenLocal() | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") | ||
implementation 'io.quarkus:quarkus-core' | ||
} | ||
|
||
group 'org.acme' | ||
version '1.0.0-SNAPSHOT' | ||
|
||
compileJava { | ||
options.encoding = 'UTF-8' | ||
options.compilerArgs << '-parameters' | ||
} |
18 changes: 18 additions & 0 deletions
18
...ts/gradle/src/test/resources/multi-module-included-build/external-library/settings.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,18 @@ | ||
pluginManagement { | ||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
if (System.properties.containsKey('maven.repo.local')) { | ||
maven { | ||
url System.properties.get('maven.repo.local') | ||
} | ||
} else { | ||
mavenLocal() | ||
} | ||
} | ||
plugins { | ||
id 'io.quarkus' version "${quarkusPluginVersion}" | ||
} | ||
} | ||
|
||
rootProject.name='external-library' |
10 changes: 10 additions & 0 deletions
10
...s/multi-module-included-build/external-library/src/main/java/org/acme/lib/LibService.java
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,10 @@ | ||
package org.acme.lib; | ||
|
||
import javax.inject.Singleton; | ||
|
||
@Singleton | ||
public class LibService { | ||
public String bar() { | ||
return "bar"; | ||
} | ||
} |
Empty file.
4 changes: 4 additions & 0 deletions
4
integration-tests/gradle/src/test/resources/multi-module-included-build/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 @@ | ||
#Gradle properties | ||
#Tue Aug 25 06:41:36 GMT 2020 | ||
quarkusPlatformArtifactId=quarkus-bom | ||
quarkusPlatformGroupId=io.quarkus |