Skip to content

Commit

Permalink
Init extension gradle plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
glefloch committed Sep 16, 2021
1 parent 0f0f0c3 commit 9f7b523
Show file tree
Hide file tree
Showing 111 changed files with 893 additions and 208 deletions.
21 changes: 21 additions & 0 deletions devtools/gradle/application-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
dependencies {
implementation "io.quarkus:quarkus-devtools-common:${version}"
implementation "io.quarkus:quarkus-core-deployment:${version}"

testImplementation "io.quarkus:quarkus-project-core-extension-codestarts:${version}"
testImplementation "io.quarkus:quarkus-devmode-test-utils:${version}"
testImplementation "io.quarkus:quarkus-devtools-testing:${version}"
}

group = "io.quarkus"

gradlePlugin {
plugins {
quarkusPlugin {
id = 'io.quarkus'
implementationClass = 'io.quarkus.gradle.QuarkusPlugin'
displayName = 'Quarkus Plugin'
description = 'Builds a Quarkus application, and provides helpers to launch dev-mode, the Quarkus CLI, building of native images'
}
}
}
118 changes: 118 additions & 0 deletions devtools/gradle/application-plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>io.quarkus</groupId>
<artifactId>io.quarkus.gradle.plugin.parent</artifactId>
<version>999-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>io.quarkus.gradle.plugin</artifactId>
<packaging>pom</packaging>
<name>Quarkus - Gradle Plugin</name>
<description>Quarkus - Gradle Plugin</description>

<dependencies>
<!-- Compile -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bootstrap-core</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-core-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-devtools-common</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-project-core-extension-codestarts</artifactId>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-devmode-test-utils</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>gradle</id>
<phase>prepare-package</phase>
<configuration>
<executable>${gradle.executable}</executable>
<arguments>
<argument>clean</argument>
<argument>${gradle.task}</argument>
<argument>-Pdescription=${project.description}</argument>
<argument>-Dmaven.repo.local=${settings.localRepository}</argument>
<argument>-S</argument>
<argument>--stacktrace</argument>
<argument>--no-daemon</argument>
</arguments>
<environmentVariables>
<MAVEN_REPO_LOCAL>${settings.localRepository}</MAVEN_REPO_LOCAL>
<GRADLE_OPTS>${env.MAVEN_OPTS}</GRADLE_OPTS>
</environmentVariables>
<skip>${skip.gradle.build}</skip>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>build/libs/application-plugin-${project.version}.jar</file>
<type>jar</type>
</artifact>
<artifact>
<file>build/libs/application-plugin-${project.version}-javadoc.jar</file>
<type>jar</type>
<classifier>javadoc</classifier>
</artifact>
<artifact>
<file>build/libs/application-plugin-${project.version}-sources.jar</file>
<type>jar</type>
<classifier>sources</classifier>
</artifact>
</artifacts>
<skipAttach>${skip.gradle.build}</skipAttach>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
110 changes: 50 additions & 60 deletions devtools/gradle/build.gradle
Original file line number Diff line number Diff line change
@@ -1,79 +1,69 @@
plugins {
id 'com.gradle.plugin-publish' version '0.16.0'
id 'java-gradle-plugin'
}
if (JavaVersion.current().isJava9Compatible()) {
compileJava.options.compilerArgs.addAll(['--release', '11'])
}
compileJava {
options.encoding = 'UTF-8'
sourceCompatibility = '11'
targetCompatibility = '11'
id 'com.gradle.plugin-publish' version '0.16.0' apply false
}

compileTestJava {
options.encoding = 'UTF-8'
}
subprojects {
apply plugin: 'java-gradle-plugin'
apply plugin: 'com.gradle.plugin-publish'

repositories {
// in case a custom local repo is configured we are going to use that instead of the default mavenLocal()
if (System.properties.containsKey('maven.repo.local')) {
maven {
url System.properties.get('maven.repo.local')
}
} else {
mavenLocal()
if (JavaVersion.current().isJava9Compatible()) {
compileJava.options.compilerArgs.addAll(['--release', '11'])
}
compileJava {
options.encoding = 'UTF-8'
sourceCompatibility = '11'
targetCompatibility = '11'
}
mavenCentral()
}

dependencies {
api gradleApi()
compileTestJava {
options.encoding = 'UTF-8'
}

implementation "io.quarkus:quarkus-bootstrap-core:${version}"
implementation "io.quarkus:quarkus-devtools-common:${version}"
implementation "io.quarkus:quarkus-core-deployment:${version}"
repositories {
// in case a custom local repo is configured we are going to use that instead of the default mavenLocal()
if (System.properties.containsKey('maven.repo.local')) {
maven {
url System.properties.get('maven.repo.local')
}
} else {
mavenLocal()
}
mavenCentral()
}

testImplementation "io.quarkus:quarkus-project-core-extension-codestarts:${version}"
testImplementation 'org.assertj:assertj-core:3.20.2'
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.0'
testImplementation "io.quarkus:quarkus-devmode-test-utils:${version}"
testImplementation "io.quarkus:quarkus-devtools-testing:${version}"
testImplementation gradleTestKit()
}
dependencies {
api gradleApi()

test {
// propagate the custom local maven repo, in case it's configured
if (System.properties.containsKey('maven.repo.local')) {
systemProperty 'maven.repo.local', System.properties.get('maven.repo.local')
}
testLogging {
events "passed", "skipped", "failed"
implementation "io.quarkus:quarkus-bootstrap-core:${version}"

testImplementation gradleTestKit()
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.2'
testImplementation 'org.assertj:assertj-core:3.20.2'
}
useJUnitPlatform()
}

javadoc {
options.addStringOption('encoding', 'UTF-8')
}
test {
// propagate the custom local maven repo, in case it's configured
if (System.properties.containsKey('maven.repo.local')) {
systemProperty 'maven.repo.local', System.properties.get('maven.repo.local')
}
testLogging {
events "passed", "skipped", "failed"
}
useJUnitPlatform()
}

pluginBundle {
website = 'https://quarkus.io/'
vcsUrl = 'https://github.com/quarkusio/quarkus'
tags = ['quarkus', 'quarkusio', 'graalvm']
}
javadoc {
options.addStringOption('encoding', 'UTF-8')
}

gradlePlugin {
plugins {
quarkusPlugin {
id = 'io.quarkus'
implementationClass = 'io.quarkus.gradle.QuarkusPlugin'
displayName = 'Quarkus Plugin'
description = 'Builds a Quarkus application, and provides helpers to launch dev-mode, the Quarkus CLI, building of native images'
}
pluginBundle {
website = 'https://quarkus.io/'
vcsUrl = 'https://github.com/quarkusio/quarkus'
tags = ['quarkus', 'quarkusio', 'graalvm']
}
}

wrapper {
distributionType = Wrapper.DistributionType.ALL
}

17 changes: 17 additions & 0 deletions devtools/gradle/extension-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
dependencies {
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${jacksonVersion}"
}

group = "io.quarkus.extension"

gradlePlugin {
plugins {
quarkusBootstrapPlugin {
id = 'io.quarkus.extension'
implementationClass = 'io.quarkus.extension.gradle.QuarkusExtensionPlugin'
displayName = 'Quarkus Extension Plugin'
description = 'Builds a Quarkus extension'
}
}
}
1 change: 1 addition & 0 deletions devtools/gradle/extension-plugin/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jacksonVersion = 2.12.4
93 changes: 93 additions & 0 deletions devtools/gradle/extension-plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>io.quarkus</groupId>
<artifactId>io.quarkus.gradle.plugin.parent</artifactId>
<version>999-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>io.quarkus.extension</groupId>
<artifactId>io.quarkus.extension.gradle.plugin</artifactId>
<packaging>pom</packaging>
<name>Quarkus - Extension Gradle Plugin</name>
<description>Quarkus - Extension Gradle Plugin</description>

<dependencies>
<!-- Compile -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bootstrap-core</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>gradle</id>
<phase>prepare-package</phase>
<configuration>
<executable>${gradle.executable}</executable>
<arguments>
<argument>clean</argument>
<argument>${gradle.task}</argument>
<argument>-Pdescription=${project.description}</argument>
<argument>-Dmaven.repo.local=${settings.localRepository}</argument>
<argument>-S</argument>
<argument>--stacktrace</argument>
<argument>--no-daemon</argument>
</arguments>
<environmentVariables>
<MAVEN_REPO_LOCAL>${settings.localRepository}</MAVEN_REPO_LOCAL>
<GRADLE_OPTS>${env.MAVEN_OPTS}</GRADLE_OPTS>
</environmentVariables>
<skip>${skip.gradle.build}</skip>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>build/libs/extension-plugin-${project.version}.jar</file>
<type>jar</type>
</artifact>
<artifact>
<file>build/libs/extension-plugin-${project.version}-javadoc.jar</file>
<type>jar</type>
<classifier>javadoc</classifier>
</artifact>
<artifact>
<file>build/libs/extension-plugin-${project.version}-sources.jar</file>
<type>jar</type>
<classifier>sources</classifier>
</artifact>
</artifacts>
<skipAttach>${skip.gradle.build}</skipAttach>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 9f7b523

Please sign in to comment.