-
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.
- Loading branch information
Showing
59 changed files
with
1,656 additions
and
222 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
30 changes: 30 additions & 0 deletions
30
devtools/gradle/src/main/java/io/quarkus/gradle/GroovyBuildFileFromConnector.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,30 @@ | ||
package io.quarkus.gradle; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
import java.util.List; | ||
|
||
import org.apache.maven.model.Dependency; | ||
|
||
import io.quarkus.devtools.project.buildfile.AbstractGroovyGradleBuildFile; | ||
import io.quarkus.platform.descriptor.QuarkusPlatformDescriptor; | ||
|
||
public class GroovyBuildFileFromConnector extends AbstractGroovyGradleBuildFile { | ||
|
||
private final ConnectorDependencyResolver dependencyResolver = new ConnectorDependencyResolver(); | ||
|
||
public GroovyBuildFileFromConnector(final Path projectDirPath, final QuarkusPlatformDescriptor platformDescriptor) { | ||
super(projectDirPath, platformDescriptor); | ||
} | ||
|
||
public GroovyBuildFileFromConnector(Path projectDirPath, QuarkusPlatformDescriptor platformDescriptor, | ||
Path rootProjectPath) { | ||
super(projectDirPath, platformDescriptor, rootProjectPath); | ||
} | ||
|
||
@Override | ||
public List<Dependency> getDependencies() throws IOException { | ||
return dependencyResolver.getDependencies(getBuildContent(), getProjectDirPath()); | ||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
devtools/gradle/src/main/java/io/quarkus/gradle/KotlinBuildFileFromConnector.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,29 @@ | ||
package io.quarkus.gradle; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
import java.util.List; | ||
|
||
import org.apache.maven.model.Dependency; | ||
|
||
import io.quarkus.devtools.project.buildfile.AbstractKotlinGradleBuildFile; | ||
import io.quarkus.platform.descriptor.QuarkusPlatformDescriptor; | ||
|
||
public class KotlinBuildFileFromConnector extends AbstractKotlinGradleBuildFile { | ||
|
||
private final ConnectorDependencyResolver dependencyResolver = new ConnectorDependencyResolver(); | ||
|
||
public KotlinBuildFileFromConnector(Path projectDirPath, QuarkusPlatformDescriptor platformDescriptor) { | ||
super(projectDirPath, platformDescriptor); | ||
} | ||
|
||
public KotlinBuildFileFromConnector(Path projectDirPath, QuarkusPlatformDescriptor platformDescriptor, | ||
Path rootProjectPath) { | ||
super(projectDirPath, platformDescriptor, rootProjectPath); | ||
} | ||
|
||
@Override | ||
public List<Dependency> getDependencies() throws IOException { | ||
return dependencyResolver.getDependencies(getBuildContent(), getProjectDirPath()); | ||
} | ||
} |
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
40 changes: 40 additions & 0 deletions
40
devtools/gradle/src/test/java/io/quarkus/gradle/GroovyBuildFileTest.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,40 @@ | ||
package io.quarkus.gradle; | ||
|
||
import java.io.IOException; | ||
import java.net.URI; | ||
import java.net.URISyntaxException; | ||
import java.net.URL; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.List; | ||
|
||
import org.apache.maven.model.Dependency; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.mockito.Mockito; | ||
|
||
import io.quarkus.platform.descriptor.QuarkusPlatformDescriptor; | ||
|
||
class GroovyBuildFileTest extends AbstractBuildFileTest { | ||
|
||
private static GroovyBuildFileFromConnector buildFile; | ||
|
||
@BeforeAll | ||
public static void beforeAll() throws URISyntaxException { | ||
URL url = GroovyBuildFileTest.class.getClassLoader().getResource("gradle-project"); | ||
URI uri = url.toURI(); | ||
Path gradleProjectPath = Paths.get(uri); | ||
final QuarkusPlatformDescriptor descriptor = Mockito.mock(QuarkusPlatformDescriptor.class); | ||
buildFile = new GroovyBuildFileFromConnector(gradleProjectPath, descriptor); | ||
} | ||
|
||
@Override | ||
String getProperty(String propertyName) throws IOException { | ||
return buildFile.getProperty(propertyName); | ||
} | ||
|
||
@Override | ||
List<Dependency> getDependencies() throws IOException { | ||
return buildFile.getDependencies(); | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
devtools/gradle/src/test/java/io/quarkus/gradle/KotlinBuildFileTest.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,40 @@ | ||
package io.quarkus.gradle; | ||
|
||
import java.io.IOException; | ||
import java.net.URI; | ||
import java.net.URISyntaxException; | ||
import java.net.URL; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.List; | ||
|
||
import org.apache.maven.model.Dependency; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.mockito.Mockito; | ||
|
||
import io.quarkus.platform.descriptor.QuarkusPlatformDescriptor; | ||
|
||
class KotlinBuildFileTest extends AbstractBuildFileTest { | ||
|
||
private static KotlinBuildFileFromConnector buildFile; | ||
|
||
@BeforeAll | ||
public static void beforeAll() throws URISyntaxException { | ||
URL url = KotlinBuildFileTest.class.getClassLoader().getResource("gradle-kts-project"); | ||
URI uri = url.toURI(); | ||
Path gradleProjectPath = Paths.get(uri); | ||
final QuarkusPlatformDescriptor descriptor = Mockito.mock(QuarkusPlatformDescriptor.class); | ||
buildFile = new KotlinBuildFileFromConnector(gradleProjectPath, descriptor); | ||
} | ||
|
||
@Override | ||
String getProperty(String propertyName) throws IOException { | ||
return buildFile.getProperty(propertyName); | ||
} | ||
|
||
@Override | ||
List<Dependency> getDependencies() throws IOException { | ||
return buildFile.getDependencies(); | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
devtools/gradle/src/test/resources/gradle-kts-project/build.gradle.kts
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,35 @@ | ||
plugins { | ||
java | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
|
||
val quarkusVersion: String by project | ||
|
||
dependencies { | ||
implementation("io.quarkus:quarkus-jsonp") | ||
implementation("io.quarkus:quarkus-jsonb") | ||
constraints { | ||
implementation("io.quarkus:quarkus-jsonb:0.10.0") { | ||
because("to test constraints") | ||
} | ||
} | ||
implementation(enforcedPlatform("io.quarkus:quarkus-bom:${quarkusVersion}")) | ||
implementation("io.quarkus:quarkus-resteasy") | ||
|
||
testImplementation("io.quarkus:quarkus-junit5") | ||
testImplementation("io.rest-assured:rest-assured") | ||
} | ||
|
||
tasks { | ||
test { | ||
dependsOn("cleanTest") | ||
useJUnitPlatform() | ||
|
||
// @NativeImageTest and JVM mode tests can't be mixed in the same run | ||
setForkEvery(1) | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
devtools/gradle/src/test/resources/gradle-kts-project/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 @@ | ||
quarkusVersion = 0.23.2 |
Empty file.
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
3 changes: 3 additions & 0 deletions
3
...r-json/src/main/resources/bundled-codestarts/buildtool/gradle-kotlin-dsl/base/..gitignore
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 @@ | ||
# Gradle | ||
.gradle/ | ||
build/ |
Oops, something went wrong.