Skip to content
Closed
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
8 changes: 8 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ jobs:
- name: Check Maven publication
run: ./gradlew publishToMavenLocal sourceTarball

- name: Polaris Apprunner Gradle plugin
working-directory: tools/apprunner
run: ./gradlew --continue check

- name: Check Apprunner Gradle Maven publication
working-directory: tools/apprunner
run: ./gradlew publishToMavenLocal

- name: Archive test results
uses: actions/upload-artifact@v4
if: always()
Expand Down
33 changes: 33 additions & 0 deletions apprunner-demo-in-tree/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

plugins {
id("polaris-server")
id("org.apache.polaris.apprunner")
}

dependencies { polarisQuarkusServer(project(":polaris-quarkus-server", "quarkusRunner")) }

testing {
suites {
val demoTest by registering(JvmTestSuite::class)
}
}

polarisQuarkusApp { includeTask(tasks.named("demoTest")) }
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.polaris.apprunner.demo;

import org.junit.jupiter.api.Test;

public class DemoTest {
@Test
public void test() {
System.err.println(System.getProperty("quarkus.http.test-port"));
System.err.println(System.getProperty("quarkus.http.test-url"));
System.err.println(System.getProperty("quarkus.management.test-port"));
System.err.println(System.getProperty("quarkus.management.test-url"));
}
}
63 changes: 63 additions & 0 deletions apprunner-demo-tarball/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

plugins {
id("polaris-server")
id("org.apache.polaris.apprunner")
}

// Gradle configuration to reference the tarball
val polarisTarball by
configurations.creating { description = "Used to reference the distribution tarball" }

dependencies { polarisTarball(project(":polaris-quarkus-server", "distributionTar")) }

testing {
suites {
val demoTest by registering(JvmTestSuite::class)
}
}

// Directory where the Polaris tarball is extracted to
val unpackedTarball = project.layout.buildDirectory.dir("polaris-tarball")

// Extracts the Polaris tarball, truncating the path
val polarisUnpackedTarball by
tasks.registering(Sync::class) {
inputs.files(polarisTarball)
destinationDir = unpackedTarball.get().asFile
from(provider { tarTree(polarisTarball.singleFile) })
eachFile {
// truncates the path (removes the first path element)
relativePath = RelativePath(true, *relativePath.segments.drop(1).toTypedArray())
}
includeEmptyDirs = false
}

val demoTest =
tasks.named("demoTest") {
// Dependency to have the extracted tarball
dependsOn(polarisUnpackedTarball)
}

polarisQuarkusApp {
includeTask(demoTest)
// Reference the quarkus-run.jar in the tarball, apprunner plugin will then run that jar
executableJar = provider { unpackedTarball.get().file("quarkus-run.jar") }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.polaris.apprunner.demo;

import org.junit.jupiter.api.Test;

public class DemoTest {
@Test
public void test() {
System.err.println(System.getProperty("quarkus.http.test-port"));
System.err.println(System.getProperty("quarkus.http.test-url"));
System.err.println(System.getProperty("quarkus.management.test-port"));
System.err.println(System.getProperty("quarkus.management.test-url"));
}
}
1 change: 1 addition & 0 deletions build-logic/src/main/kotlin/polaris-root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ if (System.getProperty("idea.sync.active").toBoolean()) {
excludeDirs +
setOf(
projectDir.resolve("build-logic/.kotlin"),
projectDir.resolve("tools/apprunner/apprunner-build-logic/.kotlin"),
projectDir.resolve("integration-tests/build"),
projectDir.resolve("site/resources/_gen"),
projectDir.resolve("site/build"),
Expand Down
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ tasks.named<RatTask>("rat").configure {

excludes.add("**/kotlin-compiler*")
excludes.add("**/build-logic/.kotlin/**")

excludes.add(
"tools/apprunner/gradle-plugin/src/main/resources/META-INF/gradle-plugins/org.apache.polaris.apprunner"
)
excludes.add("tools/apprunner/maven-plugin/target/**")
}

// Pass environment variables:
Expand Down
3 changes: 3 additions & 0 deletions gradle/projects.main.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ polaris-misc-types=tools/misc-types
polaris-config-docs-annotations=tools/config-docs/annotations
polaris-config-docs-generator=tools/config-docs/generator
polaris-config-docs-site=tools/config-docs/site

apprunner-demo-in-tree=apprunner-demo-in-tree
apprunner-demo-tarball=apprunner-demo-tarball
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import java.util.Properties

includeBuild("build-logic") { name = "polaris-build-logic" }

includeBuild("tools/apprunner") { name = "polaris-apprunner" }

if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_21)) {
throw GradleException(
"""
Expand Down
47 changes: 47 additions & 0 deletions tools/apprunner/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

# Ignore Gradle wrapper jar file
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper-*.sha256

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# IntelliJ
/.idea
*.iml
*.ipr
*.iws

# Gradle
/.gradle
/apprunner-build-logic/.gradle
/apprunner-build-logic/.kotlin
**/build/
!src/**/build/

# Maven plugin / special
maven-plugin/target

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# macOS
*.DS_Store
Loading
Loading