├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── support-ticket.md ├── actions │ └── prepare-environment │ │ └── action.yml └── workflows │ ├── deploy-documentation.yml │ ├── deploy-snapshots.yml │ ├── test-graalvm-metadata.yml │ ├── test-junit-platform-native.yml │ ├── test-native-gradle-plugin.yml │ └── test-native-maven-plugin.yml ├── .gitignore ├── .sdkmanrc ├── DEVELOPING.md ├── LICENSE ├── README.md ├── THIRD_PARTY_LICENSES.txt ├── build-logic ├── aggregator │ ├── build.gradle.kts │ ├── settings.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ ├── org.graalvm.build.aggregator.gradle.kts │ │ └── org │ │ └── graalvm │ │ └── build │ │ ├── samples │ │ └── SamplesUpdateTask.kt │ │ └── tasks │ │ ├── AbstractGitTask.kt │ │ ├── GitAdd.kt │ │ ├── GitClone.kt │ │ ├── GitCommit.kt │ │ ├── GitPush.kt │ │ └── GitReset.kt ├── common-plugins │ ├── README.md │ ├── build.gradle.kts │ ├── settings.gradle.kts │ └── src │ │ └── main │ │ ├── groovy │ │ └── org.graalvm.build.github-actions-helper.gradle │ │ └── kotlin │ │ ├── org.graalvm.build.java.gradle.kts │ │ ├── org.graalvm.build.publishing.gradle.kts │ │ ├── org │ │ └── graalvm │ │ │ └── build │ │ │ └── MavenExtension.kt │ │ └── utils.kt ├── documentation-plugins │ ├── build.gradle.kts │ ├── settings.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ └── org.graalvm.build.documentation.gradle.kts ├── gradle-functional-testing │ ├── build.gradle │ ├── settings.gradle │ └── src │ │ └── main │ │ └── groovy │ │ └── org.graalvm.build.functional-testing.gradle ├── reachability-plugins │ ├── build.gradle.kts │ ├── settings.gradle.kts │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── graalvm │ │ │ └── build │ │ │ └── FetchRepositoryMetadata.java │ │ └── kotlin │ │ └── org.graalvm.build.reachability-module.gradle.kts ├── settings-plugins │ ├── README.md │ ├── build.gradle.kts │ ├── settings.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ └── org.graalvm.build.common.settings.gradle.kts └── utils-plugins │ ├── build.gradle.kts │ ├── settings.gradle.kts │ └── src │ └── main │ ├── java │ └── org │ │ └── graalvm │ │ └── build │ │ └── GenerateVersionClass.java │ ├── kotlin │ └── org.graalvm.build.utils-module.gradle.kts │ └── resources │ └── org │ └── graalvm │ └── build │ └── header.txt ├── build.gradle.kts ├── common ├── graalvm-reachability-metadata │ ├── LICENSE │ ├── build.gradle.kts │ ├── gradle │ │ ├── native-image-testing.gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle.kts │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── graalvm │ │ │ └── reachability │ │ │ ├── DirectoryConfiguration.java │ │ │ ├── GraalVMReachabilityMetadataRepository.java │ │ │ ├── Query.java │ │ │ └── internal │ │ │ ├── DefaultArtifactQuery.java │ │ │ ├── DefaultQuery.java │ │ │ ├── FileSystemRepository.java │ │ │ ├── UncheckedIOException.java │ │ │ └── index │ │ │ ├── artifacts │ │ │ ├── Artifact.java │ │ │ ├── SingleModuleJsonVersionToConfigDirectoryIndex.java │ │ │ └── VersionToConfigDirectoryIndex.java │ │ │ └── modules │ │ │ ├── FileSystemModuleToConfigDirectoryIndex.java │ │ │ ├── JsonModuleToConfigDirectoryIndex.java │ │ │ ├── ModuleEntry.java │ │ │ ├── ModuleToConfigDirectoryIndex.java │ │ │ └── StandardLocationModuleToConfigDirectoryIndex.java │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── graalvm │ │ │ └── reachability │ │ │ ├── DirectoryConfigurationTest.java │ │ │ └── internal │ │ │ ├── FileSystemRepositoryTest.java │ │ │ └── index │ │ │ ├── artifacts │ │ │ └── SingleModuleJsonVersionToConfigDirectoryIndexTest.java │ │ │ └── modules │ │ │ ├── FileSystemModuleToConfigDirectoryIndexTest.java │ │ │ ├── JsonModuleToConfigDirectoryIndexTest.java │ │ │ └── StandardLocationModuleToConfigDirectoryIndexTest.java │ │ └── resources │ │ ├── json │ │ ├── artifact-1 │ │ │ └── index.json │ │ ├── artifact-2 │ │ │ └── index.json │ │ └── modules │ │ │ ├── multi-dirs │ │ │ ├── index.json │ │ │ ├── io.netty │ │ │ │ └── netty-core │ │ │ │ │ └── placeholder.txt │ │ │ ├── jline │ │ │ │ └── placeholder.txt │ │ │ └── org │ │ │ │ └── bar │ │ │ │ └── placeholder.txt │ │ │ └── single-dir │ │ │ ├── index.json │ │ │ ├── io.netty │ │ │ └── netty-core │ │ │ │ └── placeholder.txt │ │ │ ├── jline │ │ │ └── placeholder.txt │ │ │ └── org │ │ │ └── bar │ │ │ └── placeholder.txt │ │ └── repos │ │ ├── repo1 │ │ ├── index.json │ │ └── org │ │ │ └── foo │ │ │ ├── 1.0 │ │ │ └── reflect-config.json │ │ │ ├── 1.1 │ │ │ └── reflect-config.json │ │ │ └── index.json │ │ └── repo2 │ │ ├── index.json │ │ └── org │ │ └── foo │ │ ├── 1.0 │ │ └── reflect-config.json │ │ ├── 1.1 │ │ └── reflect-config.json │ │ └── index.json ├── junit-platform-native │ ├── .gitattributes │ ├── LICENSE │ ├── README.md │ ├── build.gradle │ ├── gradle │ │ ├── native-image-testing.gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── graalvm │ │ │ │ └── junit │ │ │ │ └── platform │ │ │ │ ├── JUnitPlatformFeature.java │ │ │ │ ├── NativeImageConfigurationImpl.java │ │ │ │ ├── NativeImageJUnitLauncher.java │ │ │ │ ├── PrintTestExecutionListener.java │ │ │ │ ├── TestClassRegistrar.java │ │ │ │ └── config │ │ │ │ ├── core │ │ │ │ ├── NativeImageConfiguration.java │ │ │ │ └── PluginConfigProvider.java │ │ │ │ ├── jupiter │ │ │ │ └── JupiterConfigProvider.java │ │ │ │ ├── platform │ │ │ │ └── PlatformConfigProvider.java │ │ │ │ ├── util │ │ │ │ ├── AnnotationUtils.java │ │ │ │ └── Utils.java │ │ │ │ └── vintage │ │ │ │ └── VintageConfigProvider.java │ │ └── resources │ │ │ ├── META-INF │ │ │ └── services │ │ │ │ └── org.graalvm.junit.platform.config.core.PluginConfigProvider │ │ │ ├── extra-build-args │ │ │ └── exclude-config │ │ │ └── initialize-at-buildtime │ │ └── test │ │ └── java │ │ └── org │ │ └── graalvm │ │ └── junit │ │ ├── jupiter │ │ ├── AbstractParentClassTests.java │ │ ├── AggregateWithTests.java │ │ ├── BasicTests.java │ │ ├── ConvertWithTests.java │ │ ├── CsvSourceTests.java │ │ ├── DisplayNameGenerationTests.java │ │ ├── EnabledIfDisabledIfTests.java │ │ ├── EnumSourceTests.java │ │ ├── MethodSourceTests.java │ │ ├── NestedTests.java │ │ ├── OSTest.java │ │ ├── ParameterizedClassTests.java │ │ ├── TestMethodOrderTests.java │ │ └── TimeoutTest.java │ │ ├── platform │ │ └── TestClassRegistrarTests.java │ │ └── vintage │ │ └── BasicTests.java └── utils │ ├── LICENSE │ ├── build.gradle.kts │ ├── settings.gradle.kts │ └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── graalvm │ │ │ └── buildtools │ │ │ ├── agent │ │ │ ├── AgentConfiguration.java │ │ │ ├── AgentMode.java │ │ │ ├── ConditionalAgentMode.java │ │ │ ├── DirectAgentMode.java │ │ │ ├── DisabledAgentMode.java │ │ │ └── StandardAgentMode.java │ │ │ ├── model │ │ │ └── resources │ │ │ │ ├── ClassPathDirectoryAnalyzer.java │ │ │ │ ├── ClassPathEntryAnalyzer.java │ │ │ │ ├── Helper.java │ │ │ │ ├── JarAnalyzer.java │ │ │ │ ├── NamedValue.java │ │ │ │ ├── NativeImageFlags.java │ │ │ │ ├── PatternValue.java │ │ │ │ ├── ResourceFilter.java │ │ │ │ ├── ResourcesConfigModel.java │ │ │ │ ├── ResourcesConfigModelSerializer.java │ │ │ │ └── ResourcesModel.java │ │ │ └── utils │ │ │ ├── ExponentialBackoff.java │ │ │ ├── FileUtils.java │ │ │ ├── JUnitUtils.java │ │ │ ├── JarMetadata.java │ │ │ ├── JarScanner.java │ │ │ ├── NativeImageUtils.java │ │ │ └── SharedConstants.java │ └── resources │ │ └── access-filter.json │ └── test │ ├── java │ └── org │ │ └── graalvm │ │ └── buildtools │ │ └── utils │ │ ├── ClassPathEntryAnalyzerTest.java │ │ ├── ExponentialBackoffTest.java │ │ ├── FileUtilsTest.java │ │ └── NativeImageUtilsTest.java │ └── resources │ ├── graalvm-reachability-metadata.zip │ └── zip-slip.zip ├── config └── checkstyle.xml ├── docs ├── build.gradle.kts ├── settings.gradle.kts └── src │ └── docs │ ├── asciidoc │ ├── alternative-build-systems.adoc │ ├── announcement.adoc │ ├── changelog.adoc │ ├── css │ │ ├── docs-back.css │ │ ├── footer.css │ │ ├── images │ │ │ ├── graalvm-logo.svg │ │ │ ├── graalvm-rabbit-icon.svg │ │ │ ├── grain.png │ │ │ ├── logo-header.svg │ │ │ └── metaimage-main-01.svg │ │ ├── multi-lang-sample.css │ │ ├── page.css │ │ └── typography.css │ ├── docinfo-footer.html │ ├── docinfo-header.html │ ├── docinfo.html │ ├── end-to-end-gradle-guide.adoc │ ├── end-to-end-maven-guide.adoc │ ├── footer.html │ ├── gradle-plugin.adoc │ ├── highlight │ │ ├── highlight.min.js │ │ └── styles │ │ │ └── equilibrium-light.min.css │ ├── index.adoc │ ├── js │ │ └── multi-lang-sample.js │ ├── maven-plugin.adoc │ └── resources │ │ └── Fonts │ │ ├── OracleSans_Bd.ttf │ │ ├── OracleSans_BdIt.ttf │ │ ├── OracleSans_It.ttf │ │ ├── OracleSans_Lt.ttf │ │ ├── OracleSans_LtIt.ttf │ │ ├── OracleSans_Rg.ttf │ │ ├── OracleSans_SBd.ttf │ │ ├── OracleSans_SBdIt.ttf │ │ └── OracleSans_ULt.ttf │ └── snippets │ ├── gradle │ ├── groovy │ │ ├── build.gradle │ │ └── settings.gradle │ └── kotlin │ │ ├── build.gradle.kts │ │ └── settings.gradle.kts │ └── maven │ ├── metadataCopy.xml │ └── pom.xml ├── gradle.properties ├── gradle ├── libs.versions.toml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── native-gradle-plugin ├── .gitattributes ├── LICENSE ├── README.md ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src │ ├── functionalTest │ └── groovy │ │ └── org │ │ └── graalvm │ │ └── buildtools │ │ └── gradle │ │ ├── JUnitFunctionalTests.groovy │ │ ├── JavaApplicationFunctionalTest.groovy │ │ ├── JavaApplicationWithAgentFunctionalTest.groovy │ │ ├── JavaApplicationWithResourcesFunctionalTest.groovy │ │ ├── JavaApplicationWithTestsFunctionalTest.groovy │ │ ├── JavaLibraryFunctionalTest.groovy │ │ ├── KotlinApplicationWithTestsFunctionalTest.groovy │ │ ├── LayeredApplicationFunctionalTest.groovy │ │ ├── MultiProjectJavaApplicationWithTestsFunctionalTest.groovy │ │ ├── NativeConfigRepoFunctionalTest.groovy │ │ ├── NativeImageOptionsTest.groovy │ │ ├── OfficialMetadataRepoFunctionalTest.groovy │ │ └── ReachabilityMetadataFunctionalTest.groovy │ ├── main │ └── java │ │ └── org │ │ └── graalvm │ │ └── buildtools │ │ └── gradle │ │ ├── NativeImagePlugin.java │ │ ├── NativeImageService.java │ │ ├── dsl │ │ ├── GraalVMExtension.java │ │ ├── GraalVMReachabilityMetadataRepositoryExtension.java │ │ ├── NativeImageCompileOptions.java │ │ ├── NativeImageOptions.java │ │ ├── NativeImageRuntimeOptions.java │ │ ├── NativeResourcesOptions.java │ │ ├── ResourceDetectionOptions.java │ │ └── agent │ │ │ ├── AgentModeOptions.java │ │ │ ├── AgentOptions.java │ │ │ ├── ConditionalAgentModeOptions.java │ │ │ ├── DeprecatedAgentOptions.java │ │ │ ├── DirectAgentModeOptions.java │ │ │ ├── MetadataCopyOptions.java │ │ │ └── StandardAgentModeOptions.java │ │ ├── internal │ │ ├── AgentCommandLineProvider.java │ │ ├── BaseNativeImageOptions.java │ │ ├── ConfigurationCacheSupport.java │ │ ├── DefaultGraalVmExtension.java │ │ ├── DefaultTestBinaryConfig.java │ │ ├── DelegatingCompileOptions.java │ │ ├── GraalVMLogger.java │ │ ├── GraalVMReachabilityMetadataService.java │ │ ├── GradleUtils.java │ │ ├── NativeImageCommandLineProvider.java │ │ ├── NativeImageExecutableLocator.java │ │ └── agent │ │ │ └── AgentConfigurationFactory.java │ │ └── tasks │ │ ├── BuildNativeImageTask.java │ │ ├── CollectReachabilityMetadata.java │ │ ├── CreateLayerOptions.java │ │ ├── GenerateResourcesConfigFile.java │ │ ├── LayerOptions.java │ │ ├── MetadataCopyTask.java │ │ ├── NativeRunTask.java │ │ ├── UseLayerOptions.java │ │ ├── actions │ │ ├── CleanupAgentFilesAction.java │ │ └── MergeAgentFilesAction.java │ │ └── scanner │ │ └── JarAnalyzerTransform.java │ ├── test │ └── groovy │ │ └── org │ │ └── graalvm │ │ └── buildtools │ │ └── gradle │ │ ├── NativeImagePluginTest.groovy │ │ └── tasks │ │ ├── AbstractPluginTest.groovy │ │ ├── ClasspathJarTest.groovy │ │ └── GenerateResourcesConfigFileTest.groovy │ └── testFixtures │ └── groovy │ └── org │ └── graalvm │ └── buildtools │ └── gradle │ └── fixtures │ ├── AbstractFunctionalTest.groovy │ ├── FileUtils.java │ ├── GraalVMSupport.groovy │ ├── ProcessController.groovy │ ├── TeeWriter.groovy │ └── TestResults.groovy ├── native-maven-plugin ├── LICENSE ├── README.md ├── build-plugins │ ├── build.gradle.kts │ ├── settings.gradle.kts │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── graalvm │ │ │ └── build │ │ │ └── maven │ │ │ ├── GeneratePluginDescriptor.java │ │ │ ├── GenerateRuntimeMetadata.java │ │ │ └── MavenTask.java │ │ └── kotlin │ │ ├── org.graalvm.build.maven-embedder.gradle.kts │ │ ├── org.graalvm.build.maven-functional-testing.gradle.kts │ │ └── org.graalvm.build.maven-plugin.gradle.kts ├── build.gradle.kts ├── config │ └── settings.xml ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── reproducers │ ├── issue-144 │ │ ├── child │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── org │ │ │ │ │ └── graalvm │ │ │ │ │ └── demo │ │ │ │ │ ├── Application.java │ │ │ │ │ └── Calculator.java │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── graalvm │ │ │ │ └── demo │ │ │ │ └── CalculatorTest.java │ │ └── pom.xml │ └── issue-612 │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── graalvm │ │ └── demo │ │ ├── Application.java │ │ └── Calculator.java ├── settings.gradle.kts └── src │ ├── functionalTest │ └── groovy │ │ └── org │ │ └── graalvm │ │ └── buildtools │ │ └── maven │ │ ├── JUnitFunctionalTests.groovy │ │ ├── JavaApplicationFunctionalTest.groovy │ │ ├── JavaApplicationWithAgentFunctionalTest.groovy │ │ ├── JavaApplicationWithResourcesFunctionalTest.groovy │ │ ├── JavaApplicationWithTestsFunctionalTest.groovy │ │ ├── JavaLibraryFunctionalTest.groovy │ │ ├── MetadataRepositoryFunctionalTest.groovy │ │ ├── OfficialMetadataRepositoryFunctionalTest.groovy │ │ ├── SBOMFunctionalTest.groovy │ │ └── issues │ │ ├── ExcludeDependenciesFunctionalTest.groovy │ │ └── JavaAppWithTestsAndParentPomFunctionalTest.groovy │ ├── main │ ├── java │ │ └── org │ │ │ └── graalvm │ │ │ └── buildtools │ │ │ ├── maven │ │ │ ├── AbstractNativeImageMojo.java │ │ │ ├── AbstractNativeMojo.java │ │ │ ├── AbstractResourceConfigMojo.java │ │ │ ├── AddReachabilityMetadataMojo.java │ │ │ ├── DeprecatedNativeBuildMojo.java │ │ │ ├── MergeAgentFilesMojo.java │ │ │ ├── MetadataCopyMojo.java │ │ │ ├── NativeBuildResourceConfigMojo.java │ │ │ ├── NativeBuildTestResourceConfigMojo.java │ │ │ ├── NativeCompileMojo.java │ │ │ ├── NativeCompileNoForkMojo.java │ │ │ ├── NativeExtension.java │ │ │ ├── NativeTestMojo.java │ │ │ ├── WriteArgsFileMojo.java │ │ │ ├── config │ │ │ │ ├── AbstractMergeAgentFilesMojo.java │ │ │ │ ├── ExcludeConfigConfiguration.java │ │ │ │ ├── MetadataRepositoryConfiguration.java │ │ │ │ └── agent │ │ │ │ │ ├── AgentConfiguration.java │ │ │ │ │ ├── AgentOptionsConfiguration.java │ │ │ │ │ ├── MetadataCopyConfiguration.java │ │ │ │ │ └── ModesConfiguration.java │ │ │ └── sbom │ │ │ │ ├── ArtifactAdapter.java │ │ │ │ ├── ArtifactAdapterResolver.java │ │ │ │ ├── ArtifactToPackageNameResolver.java │ │ │ │ ├── FileWalkerUtility.java │ │ │ │ └── SBOMGenerator.java │ │ │ └── utils │ │ │ ├── AgentUtils.java │ │ │ ├── NativeImageConfigurationUtils.java │ │ │ ├── Utils.java │ │ │ └── Xpp3DomParser.java │ └── resources │ │ └── META-INF │ │ └── plexus │ │ └── components.xml │ ├── seeding-build │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── graalvm │ │ │ └── demo │ │ │ ├── Application.java │ │ │ └── Calculator.java │ │ └── test │ │ └── java │ │ └── org │ │ └── graalvm │ │ └── demo │ │ └── CalculatorTest.java │ ├── test │ └── groovy │ │ └── org │ │ └── graalvm │ │ └── buildtools │ │ └── maven │ │ ├── AbstractNativeImageMojoTest.groovy │ │ └── MetadataRepositoryConfigurationTest.groovy │ └── testFixtures │ └── groovy │ └── org │ └── graalvm │ └── buildtools │ └── maven │ ├── AbstractGraalVMMavenFunctionalTest.groovy │ ├── GraalVMSupport.groovy │ ├── IsolatedMavenExecutor.groovy │ └── MavenExecutionResult.groovy ├── samples ├── README.md ├── java-application-with-custom-packaging │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── graalvm │ │ │ └── demo │ │ │ └── Application.java │ │ └── resources │ │ ├── application.yml │ │ └── logback.xml ├── java-application-with-custom-tests │ ├── build.gradle │ ├── gradle.properties │ ├── settings.gradle │ └── src │ │ ├── assembly │ │ └── test-jar-with-dependencies.xml │ │ ├── integTest │ │ └── java │ │ │ └── org │ │ │ └── graalvm │ │ │ └── demo │ │ │ └── CalculatorTest.java │ │ └── main │ │ └── java │ │ └── org │ │ └── graalvm │ │ └── demo │ │ ├── Application.java │ │ └── Calculator.java ├── java-application-with-extra-sourceset │ ├── build.gradle │ ├── build.gradle.kts │ ├── gradle.properties │ ├── settings.gradle │ └── src │ │ ├── graal │ │ └── java │ │ │ └── org │ │ │ └── graalvm │ │ │ └── demo │ │ │ └── ApplicationFeature.java │ │ └── main │ │ └── java │ │ └── org │ │ └── graalvm │ │ └── demo │ │ └── Application.java ├── java-application-with-reflection │ ├── build.gradle │ ├── gradle.properties │ ├── pom.xml │ ├── settings.gradle │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── org │ │ │ │ │ └── graalvm │ │ │ │ │ └── demo │ │ │ │ │ ├── Application.java │ │ │ │ │ ├── Calculator.java │ │ │ │ │ └── Message.java │ │ │ └── resources │ │ │ │ ├── META-INF │ │ │ │ └── native-image │ │ │ │ │ ├── jni-config.json │ │ │ │ │ ├── predefined-classes-config.json │ │ │ │ │ ├── proxy-config.json │ │ │ │ │ ├── reflect-config.json │ │ │ │ │ ├── resource-config.json │ │ │ │ │ └── serialization-config.json │ │ │ │ └── access-filter.json │ │ └── test │ │ │ ├── java │ │ │ └── org │ │ │ │ └── graalvm │ │ │ │ └── demo │ │ │ │ ├── ApplicationTest.java │ │ │ │ └── CalculatorTest.java │ │ │ └── resources │ │ │ └── access-filter.json │ └── user-code-filter.json ├── java-application-with-resources │ ├── build.gradle │ ├── gradle.properties │ ├── pom.xml │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── graalvm │ │ │ │ └── demo │ │ │ │ ├── Application.java │ │ │ │ └── Calculator.java │ │ └── resources │ │ │ └── message.txt │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── graalvm │ │ │ └── demo │ │ │ ├── ApplicationTest.java │ │ │ └── CalculatorTest.java │ │ └── resources │ │ └── org │ │ └── graalvm │ │ └── demo │ │ └── expected.txt ├── java-application-with-tests │ ├── build.gradle │ ├── gradle.properties │ ├── pom.xml │ ├── settings.gradle │ └── src │ │ ├── assembly │ │ └── test-jar-with-dependencies.xml │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── graalvm │ │ │ └── demo │ │ │ ├── Application.java │ │ │ └── Calculator.java │ │ └── test │ │ └── java │ │ └── org │ │ └── graalvm │ │ └── demo │ │ └── CalculatorTest.java ├── java-application │ ├── build.gradle │ ├── gradle.properties │ ├── pom.xml │ ├── settings.gradle │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── graalvm │ │ └── demo │ │ └── Application.java ├── java-library │ ├── build.gradle │ ├── gradle.properties │ ├── pom.xml │ ├── settings.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── graalvm │ │ │ └── demo │ │ │ └── Library.java │ │ └── test │ │ └── java │ │ └── org │ │ └── graalvm │ │ └── demo │ │ └── LibraryTest.java ├── junit-tests │ ├── build.gradle │ ├── gradle.properties │ ├── pom.xml │ ├── settings.gradle │ └── src │ │ └── test │ │ ├── java │ │ └── tests │ │ │ ├── ComplexTest.java │ │ │ ├── JUnitAnnotationsTests.java │ │ │ ├── OrderTests.java │ │ │ ├── VintageTests.java │ │ │ └── common │ │ │ ├── Fruits.java │ │ │ └── TestInterface.java │ │ └── resources │ │ └── resource.txt ├── kotlin-application-with-tests │ ├── build.gradle │ ├── gradle.properties │ ├── settings.gradle │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── ktest │ │ │ └── App.kt │ │ └── test │ │ └── kotlin │ │ └── ktest │ │ └── AppTest.kt ├── layered-java-application │ ├── build.gradle │ ├── gradle.properties │ ├── settings.gradle │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── graalvm │ │ └── demo │ │ └── Application.java ├── layered-mn-application │ ├── build.gradle │ ├── gradle.properties │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── layered │ │ │ │ └── mn │ │ │ │ └── app │ │ │ │ ├── Application.java │ │ │ │ └── HelloController.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ │ └── test │ │ └── java │ │ └── layered │ │ └── mn │ │ └── app │ │ └── LayeredMnAppTest.java ├── metadata-repo-integration │ ├── .gitignore │ ├── build.gradle │ ├── gradle.properties │ ├── pom.xml │ ├── settings.gradle │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── graalvm │ │ └── example │ │ ├── Example.java │ │ ├── H2Example.java │ │ └── NettyExample.java ├── multi-project-with-tests │ ├── core │ │ ├── build.gradle │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── graalvm │ │ │ │ └── demo │ │ │ │ └── Application.java │ │ │ └── test │ │ │ ├── java │ │ │ └── org │ │ │ │ └── graalvm │ │ │ │ └── demo │ │ │ │ └── CalculatorTest.java │ │ │ └── resources │ │ │ └── hello.txt │ ├── gradle.properties │ ├── pom.xml │ ├── settings.gradle │ └── utils │ │ ├── build.gradle │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── graalvm │ │ └── demo │ │ └── Calculator.java └── native-config-integration │ ├── build.gradle │ ├── config-directory │ ├── index.json │ └── org.graalvm.internal │ │ └── library-with-reflection │ │ ├── 1 │ │ └── reflect-config.json │ │ └── index.json │ ├── gradle.properties │ ├── pom.xml │ ├── settings.gradle │ └── src │ └── main │ ├── assembly │ └── assembly.xml │ └── java │ └── org │ └── graalvm │ └── example │ └── Application.java ├── settings.gradle.kts └── test-support └── library-with-reflection ├── build.gradle.kts ├── settings.gradle.kts └── src └── main └── java └── org └── graalvm └── internal └── reflect ├── Greeter.java └── Message.java /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | *.java text 5 | *.html text 6 | *.kt text 7 | *.kts text 8 | *.md text diff=markdown 9 | *.py text diff=python executable 10 | *.pl text diff=perl executable 11 | *.pm text diff=perl 12 | *.css text diff=css 13 | *.js text 14 | *.sql text 15 | *.q text 16 | 17 | *.sh text eol=lf 18 | gradlew text eol=lf 19 | 20 | *.bat text eol=crlf 21 | *.cmd text eol=crlf 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | **Please make sure that you are using the latest plugin version, and that similar feature hasn't been [requested before](https://github.com/graalvm/native-build-tools/issues).** 13 | 14 | **Describe the solution you'd like** 15 | A clear and concise description of what you want to happen. 16 | 17 | **Describe alternatives you've considered** 18 | A clear and concise description of any alternative solutions or features you've considered. 19 | 20 | **Additional context** 21 | Add any other context or screenshots about the feature request here. 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/support-ticket.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Support ticket 3 | about: Ask a question about proper usage 4 | title: "[QUESTION]" 5 | labels: question 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the problem** 11 | A clear and concise description of what the problem is. 12 | **Make sure that you have read [the documentation](https://graalvm.github.io/native-build-tools) and that you are using the latest plugin version.** 13 | 14 | **Additional context** 15 | Add any other context about the problem here. 16 | 17 | **System Info (please complete the following information):** 18 | - OS: [e.g. `Windows`] 19 | - GraalVM Version [e.g. `22.0 CE`] 20 | - Java Version [e.g. `17`] 21 | - Plugin version [e.g. `native-gradle-plugin:0.9.10`] 22 | 23 | **To Reproduce** 24 | If possible please attach a complete reproducer here (either as [a zip file](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/attaching-files) or as a link to public repository/branch). 25 | -------------------------------------------------------------------------------- /.github/actions/prepare-environment/action.yml: -------------------------------------------------------------------------------- 1 | name: '🔧 Prepare environment' 2 | description: 'Prepare the environment for testing' 3 | 4 | inputs: 5 | github-token: 6 | description: 'secrets.GITHUB_TOKEN' 7 | required: false 8 | default: '' 9 | java-version: 10 | description: 'Java version to use' 11 | required: false 12 | default: '17' 13 | push-access: 14 | description: 'Does this workflow require push access?' 15 | required: false 16 | default: '0' 17 | ssh-key: 18 | description: 'secrets.SSH_PRIVATE_KEY' 19 | required: false 20 | default: '' 21 | 22 | runs: 23 | using: "composite" 24 | steps: 25 | - name: "🔧 Install GraalVM (JDK${{ inputs.java-version }})" 26 | uses: graalvm/setup-graalvm@main 27 | with: 28 | java-version: ${{ inputs.java-version }} 29 | distribution: 'graalvm' 30 | github-token: ${{ inputs.github-token }} 31 | - name: "🔒 Configure push access" 32 | if: ${{ inputs.push-access == '1' }} 33 | shell: "bash" 34 | env: 35 | GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no" 36 | GIT_SSH: "ssh" 37 | SSH_PRIVATE_KEY: "${{ inputs.ssh-key }}" 38 | run: | 39 | mkdir -p ~/.ssh 40 | echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa 41 | chmod 700 -R ~/.ssh 42 | ssh-keygen -p -f ~/.ssh/id_rsa -m pem 43 | eval "$(ssh-agent -s)" 44 | ssh-add 45 | ssh git@github.com || true 46 | git config --global user.name 'graalvm bot' 47 | git config --global user.email 'graalvmbot@users.noreply.github.com' 48 | echo "org.ajoberstar.grgit.auth.command.allow=true" >> gradle.properties 49 | -------------------------------------------------------------------------------- /.github/workflows/deploy-documentation.yml: -------------------------------------------------------------------------------- 1 | name: "Deploy documentation to website" 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | workflow_dispatch: 8 | 9 | concurrency: 10 | group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}" 11 | cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'graalvm/native-build-tools' }} 12 | 13 | jobs: 14 | deploy-documentation: 15 | name: "Regenerate documentation website" 16 | if: github.repository == 'graalvm/native-build-tools' 17 | runs-on: ${{ matrix.os }} 18 | strategy: 19 | fail-fast: false 20 | matrix: 21 | java-version: [ 17 ] 22 | os: [ ubuntu-22.04 ] 23 | steps: 24 | - name: "☁ Checkout repository" 25 | uses: actions/checkout@v4 26 | with: 27 | ssh-key: "${{ secrets.SSH_PRIVATE_KEY }}" 28 | - name: "🔧 Prepare environment" 29 | uses: ./.github/actions/prepare-environment 30 | with: 31 | github-token: ${{ secrets.GITHUB_TOKEN }} 32 | java-version: ${{ matrix.java-version }} 33 | push-access: 1 34 | ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} 35 | - name: "🌍 Build and publish documentation" 36 | run: | 37 | ./gradlew :docs:gitPublishPush 38 | -------------------------------------------------------------------------------- /.github/workflows/deploy-snapshots.yml: -------------------------------------------------------------------------------- 1 | name: "Deploy snapshots" 2 | 3 | on: 4 | workflow_run: 5 | workflows: [ "Deploy documentation to website", "Test native-gradle-plugin", "Test native-maven-plugin", "Test junit-platform-native" ] 6 | branches: [ "master" ] 7 | types: 8 | - completed 9 | workflow_dispatch: 10 | 11 | concurrency: 12 | group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}" 13 | cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'graalvm/native-build-tools' }} 14 | 15 | jobs: 16 | deploy-snapshots: 17 | name: "Build and deploy snapshots" 18 | if: ${{ github.repository == 'graalvm/native-build-tools' }} 19 | runs-on: ${{ matrix.os }} 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | java-version: [ 17 ] 24 | os: [ ubuntu-22.04 ] 25 | steps: 26 | - name: "☁ Checkout repository" 27 | uses: actions/checkout@v4 28 | with: 29 | ssh-key: "${{ secrets.SSH_PRIVATE_KEY }}" 30 | - name: "🔧 Prepare environment" 31 | uses: ./.github/actions/prepare-environment 32 | with: 33 | github-token: ${{ secrets.GITHUB_TOKEN }} 34 | java-version: ${{ matrix.java-version }} 35 | push-access: 1 36 | ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} 37 | - name: "🌍 Build and publish snapshots" 38 | run: | 39 | ./gradlew publishToMavenLocal publishAllPublicationsToSnapshotsRepository --no-parallel 40 | -------------------------------------------------------------------------------- /.github/workflows/test-graalvm-metadata.yml: -------------------------------------------------------------------------------- 1 | name: "Test GraalVM Reachability Metadata Repository" 2 | 3 | on: 4 | push: 5 | paths: 6 | - 'common/graalvm-reachability-metadata/**' 7 | - '.github/actions/**' 8 | - '.github/workflows/test-graalvm-metadata.yml' 9 | - 'gradle/libs.versions.toml' 10 | pull_request: 11 | paths: 12 | - 'common/graalvm-reachability-metadata/**' 13 | - '.github/actions/**' 14 | - '.github/workflows/test-graalvm-metadata.yml' 15 | - 'gradle/libs.versions.toml' 16 | workflow_dispatch: 17 | 18 | concurrency: 19 | group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}" 20 | cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'graalvm/native-build-tools' }} 21 | 22 | jobs: 23 | test-graalvm-reachability-metadata: 24 | name: "Test GraalVM Reachability Metadata" 25 | runs-on: ${{ matrix.os }} 26 | strategy: 27 | fail-fast: false 28 | matrix: 29 | java-version: [ 17 ] 30 | os: [ ubuntu-22.04 ] 31 | steps: 32 | - name: "☁️ Checkout repository" 33 | uses: actions/checkout@v4 34 | - name: "🔧 Prepare environment" 35 | uses: ./.github/actions/prepare-environment 36 | with: 37 | java-version: ${{ matrix.java-version }} 38 | github-token: ${{ secrets.GITHUB_TOKEN }} 39 | - name: "❓ Checkstyle" 40 | run: ./gradlew :graalvm-reachability-metadata:checkstyleMain :graalvm-reachability-metadata:checkstyleTest 41 | - name: "❓ GraalVM Reachability Metadata test" 42 | run: ./gradlew :graalvm-reachability-metadata:test 43 | - name: "📜 Upload tests results" 44 | if: always() 45 | uses: actions/upload-artifact@v4 46 | with: 47 | name: tests-results-${{ strategy.job-index }}-${{ matrix.java-version }}-${{ matrix.os }} 48 | path: common/graalvm-reachability-metadata/build/reports/tests/ 49 | -------------------------------------------------------------------------------- /.github/workflows/test-junit-platform-native.yml: -------------------------------------------------------------------------------- 1 | name: "Test junit-platform-native" 2 | 3 | on: 4 | push: 5 | paths: 6 | - 'common/junit-platform-native/**' 7 | - '.github/actions/**' 8 | - '.github/workflows/test-junit-platform-native.yml' 9 | - 'gradle/libs.versions.toml' 10 | pull_request: 11 | paths: 12 | - 'common/junit-platform-native/**' 13 | - '.github/actions/**' 14 | - '.github/workflows/test-junit-platform-native.yml' 15 | - 'gradle/libs.versions.toml' 16 | workflow_dispatch: 17 | 18 | concurrency: 19 | group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}" 20 | cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'graalvm/native-build-tools' }} 21 | 22 | jobs: 23 | test-junit-platform-native: 24 | name: "Test junit-platform-native" 25 | runs-on: ${{ matrix.os }} 26 | strategy: 27 | fail-fast: false 28 | matrix: 29 | java-version: [ 17 ] 30 | os: [ ubuntu-22.04 ] 31 | steps: 32 | - name: "☁️ Checkout repository" 33 | uses: actions/checkout@v4 34 | - name: "🔧 Prepare environment" 35 | uses: ./.github/actions/prepare-environment 36 | with: 37 | java-version: ${{ matrix.java-version }} 38 | github-token: ${{ secrets.GITHUB_TOKEN }} 39 | - name: "❓ Checkstyle" 40 | run: ./gradlew :junit-platform-native:checkstyleMain :junit-platform-native:checkstyleTest 41 | - name: "❓ Hotspot test" 42 | run: ./gradlew :junit-platform-native:test 43 | - name: "❓ Native test" 44 | run: ./gradlew :junit-platform-native:nativeTest 45 | - name: "📜 Upload tests results" 46 | if: always() 47 | uses: actions/upload-artifact@v4 48 | with: 49 | name: tests-results-${{ strategy.job-index }}-${{ matrix.java-version }}-${{ matrix.os }} 50 | path: common/junit-platform-native/build/reports/tests/ 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ############################## 2 | ## Java 3 | ############################## 4 | .mtj.tmp/ 5 | *.class 6 | *.jar 7 | *.war 8 | *.ear 9 | *.nar 10 | hs_err_pid* 11 | 12 | ############################## 13 | ## Maven 14 | ############################## 15 | target/ 16 | pom.xml.tag 17 | pom.xml.releaseBackup 18 | pom.xml.versionsBackup 19 | pom.xml.next 20 | pom.xml.bak 21 | release.properties 22 | dependency-reduced-pom.xml 23 | buildNumber.properties 24 | .mvn/timing.properties 25 | .mvn/wrapper/maven-wrapper.jar 26 | 27 | ############################## 28 | ## Gradle 29 | ############################## 30 | bin/ 31 | /build 32 | /*/build 33 | /*/*/build 34 | /*/*/*/build 35 | /*/*/*/*/build 36 | .gradle 37 | .gradletasknamecache 38 | gradle-app.setting 39 | !gradle-wrapper.jar 40 | 41 | ############################## 42 | ## IntelliJ 43 | ############################## 44 | out/ 45 | .idea/ 46 | .idea_modules/ 47 | *.iml 48 | *.ipr 49 | *.iws 50 | 51 | ############################## 52 | ## Eclipse 53 | ############################## 54 | .settings/ 55 | bin/ 56 | tmp/ 57 | .metadata 58 | .classpath 59 | .project 60 | *.tmp 61 | *.bak 62 | *.swp 63 | *~.nib 64 | local.properties 65 | .loadpath 66 | .factorypath 67 | 68 | ############################## 69 | ## NetBeans 70 | ############################## 71 | nbproject/private/ 72 | nbbuild/ 73 | dist/ 74 | nbdist/ 75 | nbactions.xml 76 | nb-configuration.xml 77 | 78 | ############################## 79 | ## Visual Studio Code 80 | ############################## 81 | .vscode/ 82 | .code-workspace 83 | 84 | ############################## 85 | ## OS X 86 | ############################## 87 | .DS_Store 88 | -------------------------------------------------------------------------------- /.sdkmanrc: -------------------------------------------------------------------------------- 1 | # Enable auto-env through the sdkman_auto_env config 2 | # Add key=value pairs of SDKs to use below 3 | java=22.2.r11-grl 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 2 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 | 4 | The Universal Permissive License (UPL), Version 1.0 5 | 6 | Subject to the condition set forth below, permission is hereby granted to any 7 | person obtaining a copy of this software, associated documentation and/or 8 | data (collectively the "Software"), free of charge and under any and all 9 | copyright rights in the Software, and any and all patent rights owned or 10 | freely licensable by each licensor hereunder covering either (i) the 11 | unmodified Software as contributed to or provided by such licensor, or (ii) 12 | the Larger Works (as defined below), to deal in both 13 | 14 | (a) the Software, and 15 | 16 | (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 17 | one is included with the Software each a "Larger Work" to which the Software 18 | is contributed by such licensors), 19 | 20 | without restriction, including without limitation the rights to copy, create 21 | derivative works of, display, perform, and distribute the Software and make, 22 | use, sell, offer for sale, import, export, have made, and have sold the 23 | Software and the Larger Work(s), and to sublicense the foregoing rights on 24 | either these or other terms. 25 | 26 | This license is subject to the following condition: 27 | 28 | The above copyright notice and either this complete permission notice or at a 29 | minimum a reference to the UPL must be included in all copies or substantial 30 | portions of the Software. 31 | 32 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | SOFTWARE. 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Native Build Tools 2 | ![](https://github.com/graalvm/native-build-tools/actions/workflows/test-native-gradle-plugin.yml/badge.svg) 3 | ![](https://github.com/graalvm/native-build-tools/actions/workflows/test-native-maven-plugin.yml/badge.svg) 4 | 5 | Repository which contains build tool plugins for interoperability with [GraalVM Native Image](https://www.graalvm.org/reference-manual/native-image/). 6 | 7 | End-user documentation about the plugins can be found [here](https://graalvm.github.io/native-build-tools/). 8 | 9 | ## Contributing 10 | 11 | Documentation for common developer tasks can be found [here](DEVELOPING.md). 12 | 13 | ### Projects 14 | * [native-maven-plugin](native-maven-plugin/README.md) 15 | * [native-gradle-plugin](native-gradle-plugin/README.md) 16 | 17 | ### Common subprojects 18 | * [junit-platform-native](common/junit-platform-native/README.md) 19 | 20 | ### Walkthroughs 21 | 22 | * [Maven Plugin End-to-End Guide](https://graalvm.github.io/native-build-tools/latest/end-to-end-maven-guide.html) 23 | * [Gradle Plugin End-to-End Guide](https://graalvm.github.io/native-build-tools/latest/end-to-end-gradle-guide.html) 24 | 25 | ### Samples 26 | 27 | Examples can be found in the [samples subdirectory](samples). 28 | 29 | ### Contributing Code 30 | We welcome your code contributions. To get started, you will need to sign the [Oracle Contributor Agreement](https://oca.opensource.oracle.com) (OCA). 31 | 32 | Only pull requests from committers that can be verified as having signed the OCA can be accepted. 33 | -------------------------------------------------------------------------------- /build-logic/aggregator/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | plugins { 43 | `kotlin-dsl` 44 | } 45 | 46 | repositories { 47 | mavenCentral() 48 | gradlePluginPortal() 49 | } 50 | -------------------------------------------------------------------------------- /build-logic/aggregator/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021 Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | includeBuild("../settings-plugins") 44 | } 45 | 46 | plugins { 47 | id("org.graalvm.build.common") 48 | } 49 | 50 | rootProject.name = "aggregator" 51 | -------------------------------------------------------------------------------- /build-logic/aggregator/src/main/kotlin/org/graalvm/build/samples/SamplesUpdateTask.kt: -------------------------------------------------------------------------------- 1 | package org.graalvm.build.samples 2 | 3 | import org.gradle.api.DefaultTask 4 | import org.gradle.api.GradleException 5 | import org.gradle.api.file.DirectoryProperty 6 | import org.gradle.api.provider.MapProperty 7 | import org.gradle.api.tasks.Input 8 | import org.gradle.api.tasks.InputDirectory 9 | import org.gradle.api.tasks.OutputDirectory 10 | import org.gradle.api.tasks.TaskAction 11 | import java.io.File 12 | import java.io.PrintWriter 13 | import java.io.StringWriter 14 | import java.util.regex.Pattern 15 | 16 | abstract class SamplesUpdateTask : DefaultTask() { 17 | @get:InputDirectory 18 | abstract val inputDirectory: DirectoryProperty 19 | 20 | @get:Input 21 | abstract val versions: MapProperty 22 | 23 | @TaskAction 24 | fun processSamples() { 25 | inputDirectory.get().asFile.listFiles()?.forEach(::processSample) 26 | } 27 | 28 | private fun processSample(sample: File) { 29 | processPomFile(File(sample, "pom.xml")) 30 | processGradleFile(File(sample, "gradle.properties")) 31 | } 32 | 33 | private fun processGradleFile(gradleFile: File) { 34 | if (gradleFile.exists()) { 35 | gradleFile.process { key -> 36 | val quoted = Pattern.quote(key) 37 | Regex("($quoted(?:\\s*)=(?:\\s*))(.+)()") 38 | } 39 | } 40 | } 41 | 42 | private fun processPomFile(pomFile: File) { 43 | if (pomFile.exists()) { 44 | pomFile.process { key -> 45 | val quoted = Pattern.quote(key) 46 | Regex("(.*?<$quoted>)(.+?)(.*)") 47 | } 48 | } 49 | } 50 | 51 | private fun File.process(matcher: (String) -> Regex) { 52 | val allVersions = versions.get() 53 | val matchers = allVersions.keys.map { key -> Pair(key, matcher(key)) } 54 | val stringWriter = StringWriter() 55 | PrintWriter(stringWriter).use { writer -> 56 | forEachLine { str -> 57 | val line = matchers.find { (_, matcher) -> matcher.matches(str) }?.let { (key, matcher) -> 58 | str.replace(matcher, "$1${allVersions.get(key)}$3") 59 | } ?: str 60 | writer.println(line) 61 | } 62 | } 63 | this.writeText(stringWriter.toString()) 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /build-logic/common-plugins/README.md: -------------------------------------------------------------------------------- 1 | ## Shared build logic 2 | 3 | This folder contains convention plugins used by the different Gradle builds in this repository. 4 | 5 | -------------------------------------------------------------------------------- /build-logic/common-plugins/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | plugins { 43 | `kotlin-dsl` 44 | `groovy-gradle-plugin` 45 | } 46 | 47 | repositories { 48 | mavenCentral() 49 | gradlePluginPortal() 50 | } 51 | -------------------------------------------------------------------------------- /build-logic/common-plugins/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | rootProject.name = "common-plugins" 43 | -------------------------------------------------------------------------------- /build-logic/common-plugins/src/main/groovy/org.graalvm.build.github-actions-helper.gradle: -------------------------------------------------------------------------------- 1 | import groovy.json.JsonOutput 2 | 3 | def matrixDefault = [ 4 | "java-version": [ "17" ], 5 | "os": [ "ubuntu-22.04", "windows-latest" ] 6 | ] 7 | 8 | // # Following versions are disabled temporarily in order to speed up PR testing "7.3.3", "7.2", "7.1", "6.8.3", 9 | def gradleVersions = [ 10 | "gradle-version": ["current", "7.4", "8.13"], 11 | ] 12 | 13 | def gradleCachedVersions = [ 14 | "gradle-config-cache-version": ["current", "8.0.1"] 15 | ] 16 | 17 | sourceSets.configureEach { sourceSet -> 18 | if (sourceSet.name == 'functionalTest') { 19 | tasks.register("dumpFunctionalTestList") { 20 | doLast { 21 | def matrix = [ 22 | test: [] 23 | ] 24 | 25 | // add all defaults 26 | matrix.putAll(matrixDefault) 27 | 28 | // add gradle specific stuff 29 | if (matrixType == "gradle") { 30 | matrix.putAll(gradleVersions) 31 | } 32 | 33 | if (matrixType == "gradleCached") { 34 | matrix.putAll(gradleCachedVersions) 35 | } 36 | 37 | // add functional tests 38 | sourceSet.allSource.each { 39 | matrix.test << it.name.substring(0, it.name.lastIndexOf('.')) 40 | } 41 | 42 | String githubOut = System.getenv("GITHUB_OUTPUT") 43 | if (githubOut != null) { 44 | new File(githubOut).withWriterAppend { 45 | it.println "matrix=${JsonOutput.toJson(matrix)}" 46 | } 47 | } else { 48 | println "Warning: GITHUB_OUTPUT environment variable not found" 49 | } 50 | println "Build Matrix: $matrix" 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /build-logic/common-plugins/src/main/kotlin/org/graalvm/build/MavenExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | package org.graalvm.build 43 | 44 | import org.gradle.api.provider.Property 45 | 46 | abstract class MavenExtension { 47 | abstract val name: Property 48 | abstract val description: Property 49 | } 50 | -------------------------------------------------------------------------------- /build-logic/documentation-plugins/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | plugins { 43 | `kotlin-dsl` 44 | } 45 | 46 | repositories { 47 | mavenCentral() 48 | gradlePluginPortal() 49 | } 50 | 51 | dependencies { 52 | implementation("org.asciidoctor:asciidoctor-gradle-jvm:3.3.2") 53 | implementation("org.ajoberstar:gradle-git-publish:3.0.0") 54 | } 55 | -------------------------------------------------------------------------------- /build-logic/documentation-plugins/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021 Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | rootProject.name = "documentation-plugins" 43 | -------------------------------------------------------------------------------- /build-logic/gradle-functional-testing/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | plugins { 43 | id 'groovy-gradle-plugin' 44 | } 45 | -------------------------------------------------------------------------------- /build-logic/gradle-functional-testing/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = "gradle-functional-testing" 2 | -------------------------------------------------------------------------------- /build-logic/reachability-plugins/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | plugins { 43 | java 44 | `kotlin-dsl` 45 | } 46 | 47 | repositories { 48 | mavenCentral() 49 | gradlePluginPortal() 50 | } 51 | 52 | dependencies { 53 | implementation(":common-plugins") 54 | } 55 | -------------------------------------------------------------------------------- /build-logic/reachability-plugins/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021 Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | rootProject.name = "reachability-plugins" 43 | 44 | pluginManagement { 45 | includeBuild("../settings-plugins") 46 | } 47 | 48 | includeBuild("../common-plugins") 49 | 50 | plugins { 51 | id("org.graalvm.build.common") 52 | } 53 | -------------------------------------------------------------------------------- /build-logic/settings-plugins/README.md: -------------------------------------------------------------------------------- 1 | ## Settings build logic 2 | 3 | This folder contains settings plugins used by the different Gradle builds in this repository. 4 | -------------------------------------------------------------------------------- /build-logic/settings-plugins/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | plugins { 43 | `kotlin-dsl` 44 | } 45 | 46 | repositories { 47 | mavenCentral() 48 | gradlePluginPortal() 49 | } 50 | -------------------------------------------------------------------------------- /build-logic/settings-plugins/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | rootProject.name = "settings-plugins" 43 | -------------------------------------------------------------------------------- /build-logic/utils-plugins/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | plugins { 43 | java 44 | `kotlin-dsl` 45 | } 46 | 47 | repositories { 48 | mavenCentral() 49 | gradlePluginPortal() 50 | } 51 | 52 | dependencies { 53 | implementation(":common-plugins") 54 | } 55 | -------------------------------------------------------------------------------- /build-logic/utils-plugins/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021 Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | rootProject.name = "utils-plugins" 43 | 44 | pluginManagement { 45 | includeBuild("../settings-plugins") 46 | } 47 | 48 | includeBuild("../common-plugins") 49 | 50 | plugins { 51 | id("org.graalvm.build.common") 52 | } 53 | -------------------------------------------------------------------------------- /build-logic/utils-plugins/src/main/resources/org/graalvm/build/header.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, 2021 Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | plugins { 43 | id("org.graalvm.build.aggregator") 44 | } 45 | -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. 2 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 | 4 | The Universal Permissive License (UPL), Version 1.0 5 | 6 | Subject to the condition set forth below, permission is hereby granted to any 7 | person obtaining a copy of this software, associated documentation and/or 8 | data (collectively the "Software"), free of charge and under any and all 9 | copyright rights in the Software, and any and all patent rights owned or 10 | freely licensable by each licensor hereunder covering either (i) the 11 | unmodified Software as contributed to or provided by such licensor, or (ii) 12 | the Larger Works (as defined below), to deal in both 13 | 14 | (a) the Software, and 15 | 16 | (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 17 | one is included with the Software each a "Larger Work" to which the Software 18 | is contributed by such licensors), 19 | 20 | without restriction, including without limitation the rights to copy, create 21 | derivative works of, display, perform, and distribute the Software and make, 22 | use, sell, offer for sale, import, export, have made, and have sold the 23 | Software and the Larger Work(s), and to sublicense the foregoing rights on 24 | either these or other terms. 25 | 26 | This license is subject to the following condition: 27 | 28 | The above copyright notice and either this complete permission notice or at a 29 | minimum a reference to the UPL must be included in all copies or substantial 30 | portions of the Software. 31 | 32 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | SOFTWARE. -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/common/graalvm-reachability-metadata/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/main/java/org/graalvm/reachability/internal/UncheckedIOException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2022 Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | package org.graalvm.reachability.internal; 42 | 43 | import java.io.IOException; 44 | 45 | public class UncheckedIOException extends RuntimeException { 46 | public UncheckedIOException(IOException e) { 47 | super(e); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/json/artifact-1/index.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "module": "com.foo:bar", "tested-versions": ["1.0", "1.1", "1.2", "1.3"], "metadata-version": "1.0" }, 3 | { "module": "com.foo:bar", "tested-versions": ["2.0", "2.1"], "metadata-version": "2.0", "latest": true, "override": true }, 4 | { "module": "com.foo:bar-all", "tested-versions": ["2.0", "2.1"], "metadata-version": "2.0" } 5 | ] 6 | -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/json/artifact-2/index.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "module": "com.foo:bar", "tested-versions": ["1.0"], "metadata-version": "1.0", "default-for": "1\\..*" }, 3 | { "module": "com.foo:bar", "tested-versions": ["2.0", "2.1"], "metadata-version": "2.0", "latest": true }, 4 | { "module": "com.foo:baz", "tested-versions": ["1.0"], "metadata-version": "1.0", "default-for": "1.*" } 5 | ] 6 | -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/json/modules/multi-dirs/index.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "module": "io.netty:netty-core", "directory": "io.netty/netty-core"}, 3 | { "module": "org.jline:jline", "directory": "jline"}, 4 | { 5 | "module": "io.netty:netty-all", "requires": ["io.netty:netty-core", "org.jline:jline"] 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/json/modules/multi-dirs/io.netty/netty-core/placeholder.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/common/graalvm-reachability-metadata/src/test/resources/json/modules/multi-dirs/io.netty/netty-core/placeholder.txt -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/json/modules/multi-dirs/jline/placeholder.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/common/graalvm-reachability-metadata/src/test/resources/json/modules/multi-dirs/jline/placeholder.txt -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/json/modules/multi-dirs/org/bar/placeholder.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/common/graalvm-reachability-metadata/src/test/resources/json/modules/multi-dirs/org/bar/placeholder.txt -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/json/modules/single-dir/index.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "module": "io.netty:netty-core", "directory": "io.netty/netty-core"}, 3 | { "module": "org.jline:jline", "directory": "jline"}, 4 | { 5 | "module": "io.netty:netty-all", "requires": ["io.netty:netty-core"] 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/json/modules/single-dir/io.netty/netty-core/placeholder.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/common/graalvm-reachability-metadata/src/test/resources/json/modules/single-dir/io.netty/netty-core/placeholder.txt -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/json/modules/single-dir/jline/placeholder.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/common/graalvm-reachability-metadata/src/test/resources/json/modules/single-dir/jline/placeholder.txt -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/json/modules/single-dir/org/bar/placeholder.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/common/graalvm-reachability-metadata/src/test/resources/json/modules/single-dir/org/bar/placeholder.txt -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/repos/repo1/index.json: -------------------------------------------------------------------------------- 1 | [ 2 | 3 | ] 4 | -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/repos/repo1/org/foo/1.0/reflect-config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/common/graalvm-reachability-metadata/src/test/resources/repos/repo1/org/foo/1.0/reflect-config.json -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/repos/repo1/org/foo/1.1/reflect-config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/common/graalvm-reachability-metadata/src/test/resources/repos/repo1/org/foo/1.1/reflect-config.json -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/repos/repo1/org/foo/index.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "module": "org:foo", 4 | "tested-versions": [ 5 | "1.0" 6 | ], 7 | "metadata-version": "1.0" 8 | }, 9 | { 10 | "module": "org:foo", 11 | "tested-versions": [ 12 | "1.1" 13 | ], 14 | "metadata-version": "1.1", 15 | "latest": true, 16 | "override": true 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/repos/repo2/index.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "module": "org:bar", 4 | "directory": "org/foo" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/repos/repo2/org/foo/1.0/reflect-config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/common/graalvm-reachability-metadata/src/test/resources/repos/repo2/org/foo/1.0/reflect-config.json -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/repos/repo2/org/foo/1.1/reflect-config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/common/graalvm-reachability-metadata/src/test/resources/repos/repo2/org/foo/1.1/reflect-config.json -------------------------------------------------------------------------------- /common/graalvm-reachability-metadata/src/test/resources/repos/repo2/org/foo/index.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "module": "org:foo", "tested-versions": ["1.0"], "metadata-version": "1.0" }, 3 | { "module": "org:foo", "tested-versions": ["1.1"], "metadata-version": "1.1" }, 4 | { "module": "org:bar", "tested-versions": ["2.1"], "metadata-version": "1.1" } 5 | ] 6 | -------------------------------------------------------------------------------- /common/junit-platform-native/.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # These are explicitly windows files and should use crlf 5 | *.bat text eol=crlf 6 | 7 | -------------------------------------------------------------------------------- /common/junit-platform-native/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 2 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 | 4 | The Universal Permissive License (UPL), Version 1.0 5 | 6 | Subject to the condition set forth below, permission is hereby granted to any 7 | person obtaining a copy of this software, associated documentation and/or 8 | data (collectively the "Software"), free of charge and under any and all 9 | copyright rights in the Software, and any and all patent rights owned or 10 | freely licensable by each licensor hereunder covering either (i) the 11 | unmodified Software as contributed to or provided by such licensor, or (ii) 12 | the Larger Works (as defined below), to deal in both 13 | 14 | (a) the Software, and 15 | 16 | (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 17 | one is included with the Software each a "Larger Work" to which the Software 18 | is contributed by such licensors), 19 | 20 | without restriction, including without limitation the rights to copy, create 21 | derivative works of, display, perform, and distribute the Software and make, 22 | use, sell, offer for sale, import, export, have made, and have sold the 23 | Software and the Larger Work(s), and to sublicense the foregoing rights on 24 | either these or other terms. 25 | 26 | This license is subject to the following condition: 27 | 28 | The above copyright notice and either this complete permission notice or at a 29 | minimum a reference to the UPL must be included in all copies or substantial 30 | portions of the Software. 31 | 32 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | SOFTWARE. -------------------------------------------------------------------------------- /common/junit-platform-native/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/common/junit-platform-native/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /common/junit-platform-native/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /common/junit-platform-native/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | includeBuild("../../build-logic/settings-plugins") 44 | includeBuild("../../build-logic/common-plugins") 45 | } 46 | 47 | plugins { 48 | id("org.graalvm.build.common") 49 | } 50 | 51 | rootProject.name = 'junit-platform-native' 52 | -------------------------------------------------------------------------------- /common/junit-platform-native/src/main/resources/META-INF/services/org.graalvm.junit.platform.config.core.PluginConfigProvider: -------------------------------------------------------------------------------- 1 | org.graalvm.junit.platform.config.jupiter.JupiterConfigProvider 2 | org.graalvm.junit.platform.config.platform.PlatformConfigProvider 3 | org.graalvm.junit.platform.config.vintage.VintageConfigProvider 4 | -------------------------------------------------------------------------------- /common/junit-platform-native/src/main/resources/extra-build-args/exclude-config: -------------------------------------------------------------------------------- 1 | .*.jar,META-INF\/native-image\/org.junit.*.properties.* 2 | -------------------------------------------------------------------------------- /common/utils/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. 2 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 | 4 | The Universal Permissive License (UPL), Version 1.0 5 | 6 | Subject to the condition set forth below, permission is hereby granted to any 7 | person obtaining a copy of this software, associated documentation and/or 8 | data (collectively the "Software"), free of charge and under any and all 9 | copyright rights in the Software, and any and all patent rights owned or 10 | freely licensable by each licensor hereunder covering either (i) the 11 | unmodified Software as contributed to or provided by such licensor, or (ii) 12 | the Larger Works (as defined below), to deal in both 13 | 14 | (a) the Software, and 15 | 16 | (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 17 | one is included with the Software each a "Larger Work" to which the Software 18 | is contributed by such licensors), 19 | 20 | without restriction, including without limitation the rights to copy, create 21 | derivative works of, display, perform, and distribute the Software and make, 22 | use, sell, offer for sale, import, export, have made, and have sold the 23 | Software and the Larger Work(s), and to sublicense the foregoing rights on 24 | either these or other terms. 25 | 26 | This license is subject to the following condition: 27 | 28 | The above copyright notice and either this complete permission notice or at a 29 | minimum a reference to the UPL must be included in all copies or substantial 30 | portions of the Software. 31 | 32 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | SOFTWARE. -------------------------------------------------------------------------------- /common/utils/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | includeBuild("../../build-logic/settings-plugins") 44 | includeBuild("../../build-logic/common-plugins") 45 | includeBuild("../../build-logic/utils-plugins") 46 | } 47 | 48 | plugins { 49 | id("org.graalvm.build.common") 50 | } 51 | 52 | rootProject.name = "utils" 53 | -------------------------------------------------------------------------------- /common/utils/src/main/java/org/graalvm/buildtools/utils/JUnitUtils.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.buildtools.utils; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public final class JUnitUtils { 7 | 8 | public static List excludeJUnitClassInitializationFiles() { 9 | List args = new ArrayList<>(); 10 | args.add("--exclude-config"); 11 | args.add(".*.jar"); 12 | args.add("META-INF\\/native-image\\/org.junit.*.properties.*"); 13 | 14 | return args; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /common/utils/src/main/java/org/graalvm/buildtools/utils/JarMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.graalvm.buildtools.utils; 17 | 18 | import java.io.InputStream; 19 | import java.nio.file.Files; 20 | import java.nio.file.Path; 21 | import java.util.Arrays; 22 | import java.util.List; 23 | import java.util.Properties; 24 | 25 | public class JarMetadata { 26 | private final List packageList; 27 | 28 | public JarMetadata(List packageList) { 29 | this.packageList = packageList; 30 | } 31 | 32 | public List getPackageList() { 33 | return packageList; 34 | } 35 | 36 | public static JarMetadata readFrom(Path propertiesFile) { 37 | Properties props = new Properties(); 38 | try (InputStream is = Files.newInputStream(propertiesFile)) { 39 | props.load(is); 40 | } catch (Exception e) { 41 | throw new RuntimeException("Unable to read metadata from properties file " + propertiesFile, e); 42 | } 43 | String packages = (String) props.get("packages"); 44 | List packageList = packages == null ? List.of() : Arrays.asList(packages.split(",")); 45 | return new JarMetadata(packageList); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /common/utils/src/main/resources/access-filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": [ 3 | { 4 | "includeClasses": "**" 5 | }, 6 | { 7 | "excludeClasses": "org.gradle.**" 8 | }, 9 | { 10 | "excludeClasses": "org.junit.**" 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /common/utils/src/test/resources/graalvm-reachability-metadata.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/common/utils/src/test/resources/graalvm-reachability-metadata.zip -------------------------------------------------------------------------------- /common/utils/src/test/resources/zip-slip.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/common/utils/src/test/resources/zip-slip.zip -------------------------------------------------------------------------------- /docs/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | includeBuild("../build-logic/settings-plugins") 44 | includeBuild("../build-logic/documentation-plugins") 45 | } 46 | 47 | plugins { 48 | id("org.graalvm.build.common") 49 | } 50 | 51 | rootProject.name = "docs" 52 | 53 | includeBuild("../native-gradle-plugin") 54 | includeBuild("../native-maven-plugin") 55 | -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/alternative-build-systems.adoc: -------------------------------------------------------------------------------- 1 | = Native Build Tools 2 | The GraalVM team 3 | 4 | The {doctitle} project provides extensive native-image support for a variety of different use cases. 5 | However, not all projects use Gradle or Maven as their build system. 6 | Below is a list of requirements of what needs to be done to achieve a certain goal in those build systems. 7 | 8 | == Collect Conditional Metadata For Libraries 9 | Conditional metadata can be generated by inserting the Native Image Agent options into the command line of the JVM that runs the tests. 10 | To enable the agent, add the following to the command line: 11 | 12 | [source,JVM Command Line] 13 | -agentlib:native-image-agent=config-output-dir=metadata/{pid},experimental-conditional-config-part 14 | 15 | When the JVM exists, the agent will output metadata with additional information into the `metadata/{jvm-pid}` directory. 16 | The output directory in the above command line depends on the pid of the running JVM. 17 | This is especially useful when the build tool runs multiple JVMs concurrently. 18 | 19 | To produce conditional metadata, use the `native-image-configure` tool and pass the agent output directories: 20 | 21 | [source,bash] 22 | native-image-configure generate-conditional –user-code-filter=filter.json –input-dir= –input-dir=... –output-dir=final-metadata/ 23 | 24 | The `--user-code-filter` argument has the same meaning as the code filter specified in the <>. 25 | 26 | == Using Common {doctitle} Modules In A Build Tool Extension 27 | For build tool extensions written in Java, you can use the https://github.com/graalvm/native-build-tools/tree/master/common[common modules] implemented in {doctitle}. 28 | 29 | These modules are able to: 30 | 31 | * Generate the JVM command line option for enabling the agent in different modes 32 | * Query and retrieve metadata from the reachability metadata repository 33 | -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/css/docs-back.css: -------------------------------------------------------------------------------- 1 | #header, #content { 2 | max-width: 1200px; 3 | padding-left: 40px; 4 | padding-right: 40px; 5 | background-color: #ffffff; 6 | color: black; 7 | } 8 | 9 | h1 { 10 | color: black !important; 11 | } 12 | 13 | p { 14 | color: black !important; 15 | } -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/css/footer.css: -------------------------------------------------------------------------------- 1 | #footer { 2 | padding: 0px; 3 | } 4 | 5 | .foot-container { 6 | background: url('../css/images/grain.png') repeat, url('../css/images/metaimage-main-01.svg') 100% 20%/650px no-repeat, radial-gradient(79.99% 167.49% at 30.24% 129.2%, rgba(47, 79, 124, 0.8) 0%, rgba(38, 84, 107, 0) 100%), #171E25; 7 | padding: 20px 40px; 8 | } 9 | 10 | .foot-content { 11 | display: flex; 12 | justify-content: center; 13 | flex-direction: row; 14 | flex-wrap: wrap; 15 | } 16 | 17 | .foot-logo { 18 | display: flex; 19 | max-width: 8%; 20 | padding-right: 10px; 21 | align-items: center; 22 | } 23 | 24 | .foot-text { 25 | color: #ffffff; 26 | } -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/css/images/grain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/docs/src/docs/asciidoc/css/images/grain.png -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/css/typography.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'OracleSans'; 3 | src: url('../resources/Fonts/OracleSans_Rg.ttf') format('truetype'); 4 | font-weight: 400; 5 | font-style: normal; 6 | } 7 | @font-face { 8 | font-family: 'OracleSans'; 9 | src: url('../resources/Fonts/OracleSans_Lt.ttf') format('truetype'); 10 | font-weight: 200; 11 | font-style: normal; 12 | } 13 | @font-face { 14 | font-family: 'OracleSans'; 15 | src: url('../resources/Fonts/OracleSans_ULt.ttf') format('truetype'); 16 | font-weight: 100; 17 | font-style: normal; 18 | } 19 | @font-face { 20 | font-family: 'OracleSans'; 21 | src: url('../resources/Fonts/OracleSans_SBd.ttf') format('truetype'); 22 | font-weight: 600; 23 | font-style: normal; 24 | } 25 | @font-face { 26 | font-family: 'OracleSans'; 27 | src: url('../resources/Fonts/OracleSans_Bd.ttf') format('truetype'); 28 | font-weight: 700; 29 | font-style: normal; 30 | } 31 | 32 | h1 { 33 | font-size: 48px; 34 | line-height: 56px; 35 | font-weight: 700; 36 | color: #ffffff; 37 | } 38 | 39 | h2 { 40 | font-size: 40px; 41 | line-height: 48px; 42 | font-weight: 600; 43 | color: #ffffff; 44 | } 45 | 46 | h3 { 47 | font-size: 34px; 48 | line-height: 40px; 49 | font-weight: 400; 50 | color: #ffffff; 51 | } 52 | 53 | h4 { 54 | font-size: 24px; 55 | line-height: 32px; 56 | font-weight: 400; 57 | color: #ffffff; 58 | } 59 | 60 | h5 { 61 | font-size: 16px; 62 | line-height: 24px; 63 | font-weight: 400; 64 | color: #ffffff; 65 | } 66 | 67 | h6 { 68 | font-size: 14px; 69 | line-height: 24px; 70 | font-weight: 600; 71 | color: #ffffff; 72 | } -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/docinfo-footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/docinfo-header.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/docinfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 |
10 |
11 |
12 | 15 |
16 |
17 | graalvm-icon 18 |
19 |
20 |
21 |
22 |
-------------------------------------------------------------------------------- /docs/src/docs/asciidoc/footer.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 7 |
8 |
(c) {docyear}. Licensed under the Universal Permissive License (UPL), Version 1.0
9 |
10 |
11 |
12 |
-------------------------------------------------------------------------------- /docs/src/docs/asciidoc/highlight/styles/equilibrium-light.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | Theme: Equilibrium Light 3 | Author: Carlo Abelli 4 | License: ~ MIT (or more permissive) [via base16-schemes-source] 5 | Maintainer: @highlightjs/core-team 6 | Version: 2021.05.0 7 | */ 8 | pre code.hljs { 9 | display: block; 10 | overflow-x: auto; 11 | padding: 1em; 12 | color: white; 13 | } 14 | 15 | code.hljs { 16 | padding: 3px 5px 17 | } 18 | 19 | .hljs { 20 | color: white; 21 | background: none; 22 | border: 1px solid #ffc107; 23 | border-radius: 4px; 24 | } 25 | 26 | ::selection { 27 | background: gray; 28 | color: inherited; 29 | } 30 | 31 | .hljs-comment { 32 | color: white; 33 | font-style: italic; 34 | } 35 | 36 | 37 | .hljs-operator,.hljs-punctuation,.hljs-subst { 38 | color: white; 39 | } 40 | 41 | .hljs-operator { 42 | opacity: 0.8 43 | } 44 | 45 | 46 | .hljs-tag { 47 | color: #00758F; 48 | font-weight: 600; 49 | } 50 | 51 | .hljs-name { 52 | color: #ffc107; 53 | font-weight: 600; 54 | } 55 | 56 | .hljs-attr { 57 | color: #ff0091; 58 | font-weight: 400; 59 | } 60 | 61 | .hljs-bullet,.hljs-deletion,.hljs-selector-tag,.hljs-template-variable,.hljs-variable { 62 | color: #ff00b4; 63 | font-weight: 600; 64 | } 65 | 66 | .hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_ { 67 | color: #05a4bf; 68 | } 69 | 70 | .hljs-class .hljs-title,.hljs-title,.hljs-title.class_ { 71 | color: #00ff68; 72 | } 73 | 74 | .hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__ { 75 | color: #00ff68; 76 | } 77 | 78 | .hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp { 79 | color: #05a4bf; 80 | } 81 | 82 | .hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property { 83 | color: #ffc107; 84 | } 85 | 86 | .diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type { 87 | color: #ffc107; 88 | } 89 | 90 | .hljs-emphasis { 91 | color: #4e66b6; 92 | font-style: italic; 93 | } 94 | 95 | .hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string { 96 | color: #05a4bf; 97 | } 98 | 99 | .hljs-meta .hljs-keyword,.hljs-meta-keyword { 100 | font-weight: 700; 101 | } 102 | -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/index.adoc: -------------------------------------------------------------------------------- 1 | = Native Build Tools 2 | The GraalVM team 3 | 4 | The {doctitle} project provides plugins for various build tools, enabling support for building and testing native applications written in Java (or any other language compiled to JVM bytecode) using https://www.graalvm.org/reference-manual/native-image/[GraalVM Native Image]. 5 | Currently, you can build your native applications using our Gradle or Maven plugins. 6 | 7 | Each plugin takes metadata for available libraries from the https://github.com/oracle/graalvm-reachability-metadata[GraalVM reachability metadata repository] 8 | to provide better experience during the development of your native project. 9 | 10 | If you are using alternative build systems, see <>. 11 | 12 | [discrete] 13 | === Documentation 14 | 15 | If you're new to the Native Build Tools, whether as an end user or a library author, check out our: 16 | 17 | - <> 18 | - <> 19 | 20 | For detailed documentation, see the corresponding page for each build tool: 21 | 22 | - <> 23 | - <> 24 | 25 | For updates to the Native Build Tools between releases, see the full changelog <>. 26 | 27 | [discrete] 28 | === Contributing 29 | 30 | If you are interested in contributing or reporting an issue related to the plugins, please refer to the https://github.com/graalvm/native-build-tools[Native Build Tools repository]. 31 | Please note that all contributors must sign the https://oca.opensource.oracle.com/[Oracle Contributor Agreement] (OCA). 32 | 33 | [TIP] 34 | -- 35 | This repository should be used for reporting issues related specifically to the Maven or Gradle plugins for GraalVM Native Image. 36 | For issues related to frameworks such as https://spring.io/[Spring Framework] or https://micronaut.io/[Micronaut framework], please report them to their respective repositories. 37 | -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/resources/Fonts/OracleSans_Bd.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/docs/src/docs/asciidoc/resources/Fonts/OracleSans_Bd.ttf -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/resources/Fonts/OracleSans_BdIt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/docs/src/docs/asciidoc/resources/Fonts/OracleSans_BdIt.ttf -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/resources/Fonts/OracleSans_It.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/docs/src/docs/asciidoc/resources/Fonts/OracleSans_It.ttf -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/resources/Fonts/OracleSans_Lt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/docs/src/docs/asciidoc/resources/Fonts/OracleSans_Lt.ttf -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/resources/Fonts/OracleSans_LtIt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/docs/src/docs/asciidoc/resources/Fonts/OracleSans_LtIt.ttf -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/resources/Fonts/OracleSans_Rg.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/docs/src/docs/asciidoc/resources/Fonts/OracleSans_Rg.ttf -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/resources/Fonts/OracleSans_SBd.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/docs/src/docs/asciidoc/resources/Fonts/OracleSans_SBd.ttf -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/resources/Fonts/OracleSans_SBdIt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/docs/src/docs/asciidoc/resources/Fonts/OracleSans_SBdIt.ttf -------------------------------------------------------------------------------- /docs/src/docs/asciidoc/resources/Fonts/OracleSans_ULt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/docs/src/docs/asciidoc/resources/Fonts/OracleSans_ULt.ttf -------------------------------------------------------------------------------- /docs/src/docs/snippets/gradle/groovy/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021 Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | if (false) { 42 | // tag::pre-release[] 43 | pluginManagement { 44 | repositories { 45 | maven { 46 | url "https://raw.githubusercontent.com/graalvm/native-build-tools/snapshots" 47 | } 48 | gradlePluginPortal() 49 | } 50 | } 51 | // end::pre-release[] 52 | } 53 | -------------------------------------------------------------------------------- /docs/src/docs/snippets/maven/metadataCopy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | main 5 | 6 | true 7 | /tmp/test-output-dir 8 | 9 | -------------------------------------------------------------------------------- /docs/src/docs/snippets/maven/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | Standard 6 | 7 | config-output-dir=${project.build.directory}/native/agent-output 8 | 9 | user-code-filter.json 10 | extra-filter.json 11 | true 12 | 13 | 14 | 15 | 16 | caller-filter-file1.json 17 | caller-filter-file2.json 18 | 19 | 20 | access-filter-file1.json 21 | access-filter-file2.json 22 | 23 | true 24 | true 25 | true 26 | 27 | true 28 | 29 | true 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.parallel=true 2 | org.gradle.caching=true 3 | org.gradle.jvmargs=-Xms1g -Xmx1g 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /native-gradle-plugin/.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # These are explicitly windows files and should use crlf 5 | *.bat text eol=crlf 6 | 7 | -------------------------------------------------------------------------------- /native-gradle-plugin/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. 2 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 | 4 | The Universal Permissive License (UPL), Version 1.0 5 | 6 | Subject to the condition set forth below, permission is hereby granted to any 7 | person obtaining a copy of this software, associated documentation and/or 8 | data (collectively the "Software"), free of charge and under any and all 9 | copyright rights in the Software, and any and all patent rights owned or 10 | freely licensable by each licensor hereunder covering either (i) the 11 | unmodified Software as contributed to or provided by such licensor, or (ii) 12 | the Larger Works (as defined below), to deal in both 13 | 14 | (a) the Software, and 15 | 16 | (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 17 | one is included with the Software each a "Larger Work" to which the Software 18 | is contributed by such licensors), 19 | 20 | without restriction, including without limitation the rights to copy, create 21 | derivative works of, display, perform, and distribute the Software and make, 22 | use, sell, offer for sale, import, export, have made, and have sold the 23 | Software and the Larger Work(s), and to sublicense the foregoing rights on 24 | either these or other terms. 25 | 26 | This license is subject to the following condition: 27 | 28 | The above copyright notice and either this complete permission notice or at a 29 | minimum a reference to the UPL must be included in all copies or substantial 30 | portions of the Software. 31 | 32 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | SOFTWARE. -------------------------------------------------------------------------------- /native-gradle-plugin/README.md: -------------------------------------------------------------------------------- 1 | # Native Image Gradle Plugin 2 | Gradle plugin for GraalVM Native Image building 3 | ![](https://github.com/graalvm/native-build-tools/actions/workflows/test-native-gradle-plugin.yml/badge.svg) 4 | 5 | End-user documentation about the plugins can be found [here](https://graalvm.github.io/native-build-tools/). 6 | 7 | ## Building 8 | 9 | This plugin can be built with this command (from the root directory): 10 | 11 | ```bash 12 | ./gradlew :native-gradle-plugin:publishAllPublicationsToCommonRepository --no-parallel 13 | ``` 14 | 15 | The command will publish a snapshot to `build/common-repo`. For more details, see the [Developer documentation](../DEVELOPING.md). 16 | 17 | In order to run testing part of this plugin you need to get (or build) corresponding `junit-platform-native` artifact. 18 | 19 | *You can also take a look at CI workflow [here](../.github/workflows/test-native-gradle-plugin.yml).* 20 | -------------------------------------------------------------------------------- /native-gradle-plugin/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/native-gradle-plugin/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /native-gradle-plugin/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /native-gradle-plugin/src/functionalTest/groovy/org/graalvm/buildtools/gradle/NativeImageOptionsTest.groovy: -------------------------------------------------------------------------------- 1 | package org.graalvm.buildtools.gradle 2 | 3 | 4 | import org.gradle.testkit.runner.GradleRunner 5 | import spock.lang.Issue 6 | import spock.lang.Specification 7 | import spock.lang.TempDir 8 | 9 | import java.nio.file.Path 10 | 11 | class NativeImageOptionsTest extends Specification { 12 | @TempDir 13 | Path testDirectory 14 | 15 | @Issue("https://github.com/graalvm/native-build-tools/issues/109") 16 | def "toolchain defaults to the current Java version"() { 17 | when: 18 | def runner = GradleRunner.create() 19 | .forwardStdOutput(new PrintWriter(System.out)) 20 | .forwardStdError(new PrintWriter(System.err)) 21 | .withPluginClasspath() 22 | .withProjectDir(testDirectory.toFile()) 23 | 24 | 25 | def buildFile = testDirectory.resolve("build.gradle") 26 | buildFile.text = """ 27 | plugins { 28 | id 'java' 29 | id 'org.graalvm.buildtools.native' 30 | } 31 | 32 | graalvmNative.toolchainDetection = true 33 | 34 | assert graalvmNative.binaries.main.javaLauncher 35 | .get() 36 | .metadata 37 | .languageVersion 38 | .toString() == JavaVersion.current().majorVersion 39 | """ 40 | 41 | runner.build() 42 | 43 | then: 44 | noExceptionThrown() 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/dsl/agent/DirectAgentModeOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022, 2022 Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | package org.graalvm.buildtools.gradle.dsl.agent; 42 | 43 | import org.gradle.api.provider.ListProperty; 44 | import org.gradle.api.tasks.Input; 45 | 46 | public interface DirectAgentModeOptions { 47 | 48 | @Input 49 | ListProperty getOptions(); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/dsl/agent/StandardAgentModeOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022, 2022 Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | package org.graalvm.buildtools.gradle.dsl.agent; 42 | 43 | public interface StandardAgentModeOptions { 44 | } 45 | -------------------------------------------------------------------------------- /native-maven-plugin/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 2 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 | 4 | The Universal Permissive License (UPL), Version 1.0 5 | 6 | Subject to the condition set forth below, permission is hereby granted to any 7 | person obtaining a copy of this software, associated documentation and/or 8 | data (collectively the "Software"), free of charge and under any and all 9 | copyright rights in the Software, and any and all patent rights owned or 10 | freely licensable by each licensor hereunder covering either (i) the 11 | unmodified Software as contributed to or provided by such licensor, or (ii) 12 | the Larger Works (as defined below), to deal in both 13 | 14 | (a) the Software, and 15 | 16 | (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 17 | one is included with the Software each a "Larger Work" to which the Software 18 | is contributed by such licensors), 19 | 20 | without restriction, including without limitation the rights to copy, create 21 | derivative works of, display, perform, and distribute the Software and make, 22 | use, sell, offer for sale, import, export, have made, and have sold the 23 | Software and the Larger Work(s), and to sublicense the foregoing rights on 24 | either these or other terms. 25 | 26 | This license is subject to the following condition: 27 | 28 | The above copyright notice and either this complete permission notice or at a 29 | minimum a reference to the UPL must be included in all copies or substantial 30 | portions of the Software. 31 | 32 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | SOFTWARE. -------------------------------------------------------------------------------- /native-maven-plugin/README.md: -------------------------------------------------------------------------------- 1 | # Native Image Maven Plugin 2 | Maven plugin for GraalVM Native Image building 3 | ![](https://github.com/graalvm/native-build-tools/actions/workflows/test-native-maven-plugin.yml/badge.svg) 4 | 5 | End-user documentation about the plugins can be found [here](https://graalvm.github.io/native-build-tools/). 6 | 7 | ## Building 8 | 9 | This plugin can be built with this command (from the root directory): 10 | 11 | ```bash 12 | ./gradlew :native-maven-plugin:publishAllPublicationsToCommonRepository --no-parallel 13 | ``` 14 | 15 | The command will publish a snapshot to `build/common-repo`. 16 | For more details, see the [Developer documentation](../DEVELOPING.md). 17 | 18 | In order to run testing part of this plugin you need to get (or build) corresponding `junit-platform-native` artifact. 19 | 20 | *You can also take a look at CI workflow [here](../.github/workflows/test-native-maven-plugin.yml).* 21 | -------------------------------------------------------------------------------- /native-maven-plugin/build-plugins/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | plugins { 43 | `java-gradle-plugin` 44 | `kotlin-dsl` 45 | } 46 | 47 | repositories { 48 | mavenCentral() 49 | gradlePluginPortal() 50 | } 51 | -------------------------------------------------------------------------------- /native-maven-plugin/build-plugins/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | rootProject.name = "maven-build-plugins" 43 | -------------------------------------------------------------------------------- /native-maven-plugin/build-plugins/src/main/java/org/graalvm/build/maven/GeneratePluginDescriptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.graalvm.build.maven; 17 | 18 | import org.gradle.api.file.DirectoryProperty; 19 | import org.gradle.api.tasks.CacheableTask; 20 | import org.gradle.api.tasks.Internal; 21 | import org.gradle.process.JavaExecSpec; 22 | 23 | import java.io.File; 24 | import java.util.Arrays; 25 | 26 | @CacheableTask 27 | public abstract class GeneratePluginDescriptor extends MavenTask { 28 | 29 | @Internal 30 | public abstract DirectoryProperty getCommonRepository(); 31 | 32 | @Internal 33 | public abstract DirectoryProperty getLocalRepository(); 34 | 35 | public GeneratePluginDescriptor() { 36 | getArguments().set(Arrays.asList("-q", "org.apache.maven.plugins:maven-plugin-plugin:3.6.1:descriptor")); 37 | } 38 | 39 | @Override 40 | protected void prepareSpec(JavaExecSpec spec) { 41 | spec.systemProperty("common.repo.uri", getCommonRepository().getAsFile().get().toURI().toString()); 42 | spec.systemProperty("seed.repo.uri", getLocalRepository().get().getAsFile().toURI().toASCIIString()); 43 | } 44 | 45 | @Override 46 | protected void extractOutput(File tmpDir, File outputDirectory) { 47 | getFileSystemOperations().copy(spec -> { 48 | File file = new File(tmpDir, "target/classes"); 49 | spec.from(file).include("META-INF/maven/**").into(outputDirectory); 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /native-maven-plugin/config/settings.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | gradle 6 | 7 | 8 | common.repo.uri 9 | 10 | 11 | 12 | 13 | seed 14 | ${seed.repo.uri} 15 | 16 | true 17 | 18 | 19 | true 20 | 21 | 22 | 23 | common 24 | ${common.repo.uri} 25 | 26 | true 27 | 28 | 29 | true 30 | 31 | 32 | 33 | 34 | 35 | seed 36 | ${seed.repo.uri} 37 | 38 | true 39 | 40 | 41 | true 42 | 43 | 44 | 45 | common 46 | ${common.repo.uri} 47 | 48 | true 49 | 50 | 51 | true 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /native-maven-plugin/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graalvm/native-build-tools/318f6b81b8f75335c2d6f734b4f6a3619511536b/native-maven-plugin/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /native-maven-plugin/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /native-maven-plugin/reproducers/issue-144/child/src/main/java/org/graalvm/demo/Application.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Application { 4 | static String getMessage() { 5 | return "Hello, native!"; 6 | } 7 | 8 | public static void main(String[] args) { 9 | System.out.println(getMessage()); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /native-maven-plugin/reproducers/issue-144/child/src/main/java/org/graalvm/demo/Calculator.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /native-maven-plugin/reproducers/issue-144/child/src/test/java/org/graalvm/demo/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import org.junit.jupiter.api.DisplayName; 6 | import org.junit.jupiter.api.Test; 7 | import org.junit.jupiter.params.ParameterizedTest; 8 | import org.junit.jupiter.params.provider.CsvSource; 9 | 10 | class CalculatorTest { 11 | 12 | @Test 13 | @DisplayName("1 + 1 = 2") 14 | void addsTwoNumbers() { 15 | Calculator calculator = new Calculator(); 16 | assertEquals(2, calculator.add(1, 1), "1 + 1 should equal 2"); 17 | } 18 | 19 | @Test 20 | @DisplayName("1 + 2 = 3") 21 | void addsTwoNumbers2() { 22 | Calculator calculator = new Calculator(); 23 | assertEquals(3, calculator.add(1, 2), "1 + 2 should equal 3"); 24 | } 25 | 26 | @ParameterizedTest(name = "{0} + {1} = {2}") 27 | @CsvSource({ 28 | "0, 1, 1", 29 | "1, 2, 3", 30 | "49, 51, 100", 31 | "1, 100, 101" 32 | }) 33 | void add(int first, int second, int expectedResult) { 34 | Calculator calculator = new Calculator(); 35 | assertEquals(expectedResult, calculator.add(first, second), 36 | () -> first + " + " + second + " should equal " + expectedResult); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /native-maven-plugin/reproducers/issue-612/src/main/java/org/graalvm/demo/Application.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Application { 4 | static String getMessage() { 5 | return "Hello, native!"; 6 | } 7 | 8 | public static void main(String[] args) { 9 | System.out.println(getMessage()); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /native-maven-plugin/reproducers/issue-612/src/main/java/org/graalvm/demo/Calculator.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /native-maven-plugin/src/seeding-build/src/main/java/org/graalvm/demo/Application.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Application { 4 | static String getMessage() { 5 | return "Hello, native!"; 6 | } 7 | 8 | public static void main(String[] args) { 9 | System.out.println(getMessage()); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /native-maven-plugin/src/seeding-build/src/main/java/org/graalvm/demo/Calculator.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /native-maven-plugin/src/seeding-build/src/test/java/org/graalvm/demo/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import org.junit.jupiter.api.DisplayName; 6 | import org.junit.jupiter.api.Test; 7 | import org.junit.jupiter.params.ParameterizedTest; 8 | import org.junit.jupiter.params.provider.CsvSource; 9 | 10 | class CalculatorTest { 11 | 12 | @Test 13 | @DisplayName("1 + 1 = 2") 14 | void addsTwoNumbers() { 15 | Calculator calculator = new Calculator(); 16 | assertEquals(2, calculator.add(1, 1), "1 + 1 should equal 2"); 17 | } 18 | 19 | @Test 20 | @DisplayName("1 + 2 = 3") 21 | void addsTwoNumbers2() { 22 | Calculator calculator = new Calculator(); 23 | assertEquals(3, calculator.add(1, 2), "1 + 2 should equal 3"); 24 | } 25 | 26 | @ParameterizedTest(name = "{0} + {1} = {2}") 27 | @CsvSource({ 28 | "0, 1, 1", 29 | "1, 2, 3", 30 | "49, 51, 100", 31 | "1, 100, 101" 32 | }) 33 | void add(int first, int second, int expectedResult) { 34 | Calculator calculator = new Calculator(); 35 | assertEquals(expectedResult, calculator.add(first, second), 36 | () -> first + " + " + second + " should equal " + expectedResult); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /native-maven-plugin/src/test/groovy/org/graalvm/buildtools/maven/AbstractNativeImageMojoTest.groovy: -------------------------------------------------------------------------------- 1 | package org.graalvm.buildtools.maven 2 | 3 | import spock.lang.Specification 4 | 5 | class AbstractNativeImageMojoTest extends Specification { 6 | 7 | void "it can process build args"() { 8 | given: 9 | def buildArgs = [ 10 | "--exclude-config", 11 | "\\QC:\\Users\\Lahoucine EL ADDALI\\.m2\\repository\\io\\netty\\netty-transport\\4.1.108.Final\\netty-transport-4.1.108.Final.jar\\E", 12 | "^/META-INF/native-image/", 13 | "-cp C:\\Users\\Lahoucine EL ADDALI\\Desktop\\outdir\\target/java-application-with-custom-packaging-0.1.jar", 14 | "-H:ConfigurationFileDirectories=C:\\Users\\Lahoucine EL ADDALI\\Downloads\\4.5.0.0_kubernetes_kubernetes-demo-java-maven\\api\\target\\native\\generated\\generateResourceConfig" 15 | ] 16 | 17 | when: 18 | def processedArgs = AbstractNativeImageMojo.processBuildArgs(buildArgs) 19 | 20 | then: 21 | processedArgs == [ 22 | "--exclude-config", 23 | "\\QC:\\Users\\Lahoucine EL ADDALI\\.m2\\repository\\io\\netty\\netty-transport\\4.1.108.Final\\netty-transport-4.1.108.Final.jar\\E", 24 | "^/META-INF/native-image/", 25 | "-cp", 26 | "C:\\Users\\Lahoucine EL ADDALI\\Desktop\\outdir\\target/java-application-with-custom-packaging-0.1.jar", 27 | "-H:ConfigurationFileDirectories=C:\\Users\\Lahoucine EL ADDALI\\Downloads\\4.5.0.0_kubernetes_kubernetes-demo-java-maven\\api\\target\\native\\generated\\generateResourceConfig" 28 | ] 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /native-maven-plugin/src/testFixtures/groovy/org/graalvm/buildtools/maven/GraalVMSupport.groovy: -------------------------------------------------------------------------------- 1 | package org.graalvm.buildtools.maven 2 | 3 | class GraalVMSupport { 4 | 5 | static String getJavaHomeVersionString() { 6 | String javaHomeLocation = System.getenv("JAVA_HOME") 7 | return extractVersionString(javaHomeLocation) 8 | } 9 | 10 | static String getGraalVMHomeVersionString() { 11 | String graalvmHomeLocation = System.getenv("GRAALVM_HOME") 12 | return extractVersionString(graalvmHomeLocation) 13 | } 14 | 15 | private static String extractVersionString(String location) { 16 | def sout = new StringBuilder(), serr = new StringBuilder() 17 | String command = getSystemBasedCommand(location); 18 | def proc = command.execute() 19 | proc.consumeProcessOutput(sout, serr) 20 | proc.waitForOrKill(1000) 21 | assert serr.toString().isEmpty() 22 | 23 | return sout.toString() 24 | } 25 | 26 | private static String getSystemBasedCommand(String location) { 27 | if (System.getProperty("os.name", "unknown").contains("Windows")) { 28 | return location + '\\bin\\native-image.cmd --version' 29 | } else { 30 | return location + '/bin/native-image --version' 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /samples/README.md: -------------------------------------------------------------------------------- 1 | # Samples 2 | 3 | This folder contains example projects for usage of GraalVM Native Image plugins in various build tools. 4 | They are also used for functional testing of the plugins in this repository. 5 | 6 | ## Currently supported build systems 7 | 8 | Each sample contains (when applicable) both a Gradle and a Maven build. 9 | 10 | -------------------------------------------------------------------------------- /samples/java-application-with-custom-packaging/src/main/java/org/graalvm/demo/Application.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import io.micronaut.configuration.picocli.PicocliRunner; 4 | import picocli.CommandLine.Command; 5 | 6 | @Command(name = "demo", description = "...", mixinStandardHelpOptions = true) 7 | public class Application implements Runnable { 8 | 9 | public static void main(String[] args) { 10 | PicocliRunner.run(Application.class, args); 11 | } 12 | 13 | public void run() { 14 | System.out.println("Hello, native!"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/java-application-with-custom-packaging/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | micronaut: 2 | application: 3 | name: java-application-with-custom-packaging 4 | -------------------------------------------------------------------------------- /samples/java-application-with-custom-packaging/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | false 5 | 7 | 8 | %cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/java-application-with-custom-tests/gradle.properties: -------------------------------------------------------------------------------- 1 | native.gradle.plugin.version = 0.11.0-SNAPSHOT 2 | junit.jupiter.version = 5.11.0 3 | junit.platform.version = 1.11.0 4 | -------------------------------------------------------------------------------- /samples/java-application-with-custom-tests/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | plugins { 44 | id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version') 45 | } 46 | } 47 | 48 | rootProject.name = 'java-application' 49 | -------------------------------------------------------------------------------- /samples/java-application-with-custom-tests/src/integTest/java/org/graalvm/demo/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import org.junit.jupiter.api.DisplayName; 6 | import org.junit.jupiter.api.Test; 7 | import org.junit.jupiter.params.ParameterizedTest; 8 | import org.junit.jupiter.params.provider.CsvSource; 9 | 10 | class CalculatorTest { 11 | 12 | @Test 13 | @DisplayName("1 + 1 = 2") 14 | void addsTwoNumbers() { 15 | Calculator calculator = new Calculator(); 16 | assertEquals(2, calculator.add(1, 1), "1 + 1 should equal 2"); 17 | } 18 | 19 | @Test 20 | @DisplayName("1 + 2 = 3") 21 | void addsTwoNumbers2() { 22 | Calculator calculator = new Calculator(); 23 | assertEquals(3, calculator.add(1, 2), "1 + 2 should equal 3"); 24 | } 25 | 26 | @ParameterizedTest(name = "{0} + {1} = {2}") 27 | @CsvSource({ 28 | "0, 1, 1", 29 | "1, 2, 3", 30 | "49, 51, 100", 31 | "1, 100, 101" 32 | }) 33 | void add(int first, int second, int expectedResult) { 34 | Calculator calculator = new Calculator(); 35 | assertEquals(expectedResult, calculator.add(first, second), 36 | () -> first + " + " + second + " should equal " + expectedResult); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /samples/java-application-with-custom-tests/src/main/java/org/graalvm/demo/Application.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Application { 4 | static String getMessage() { 5 | return "Hello, native!"; 6 | } 7 | 8 | public static void main(String[] args) { 9 | System.out.println(getMessage()); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/java-application-with-custom-tests/src/main/java/org/graalvm/demo/Calculator.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /samples/java-application-with-extra-sourceset/gradle.properties: -------------------------------------------------------------------------------- 1 | native.gradle.plugin.version = 0.11.0-SNAPSHOT 2 | junit.jupiter.version = 5.11.0 3 | junit.platform.version = 1.11.0 4 | -------------------------------------------------------------------------------- /samples/java-application-with-extra-sourceset/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | plugins { 44 | id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version') 45 | } 46 | } 47 | 48 | rootProject.name = 'java-application' 49 | -------------------------------------------------------------------------------- /samples/java-application-with-extra-sourceset/src/graal/java/org/graalvm/demo/ApplicationFeature.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import com.oracle.svm.core.annotate.AutomaticFeature; 4 | import org.graalvm.nativeimage.hosted.Feature; 5 | 6 | import java.io.File; 7 | import java.io.FileWriter; 8 | import java.io.IOException; 9 | import java.io.PrintWriter; 10 | 11 | @AutomaticFeature 12 | public class ApplicationFeature implements Feature { 13 | @Override 14 | public void afterImageWrite(AfterImageWriteAccess access) { 15 | try (PrintWriter wrt = new PrintWriter(new FileWriter(new File(access.getImagePath().toFile().getParentFile(), "app.txt")))) { 16 | wrt.println("-------------------\n"); 17 | wrt.println("Application Feature\n"); 18 | wrt.println("-------------------\n"); 19 | } catch (IOException e) { 20 | throw new RuntimeException(e); 21 | } 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/java-application-with-extra-sourceset/src/main/java/org/graalvm/demo/Application.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Application { 4 | public static void main(String[] args) { 5 | System.out.println("Hello, native!"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/gradle.properties: -------------------------------------------------------------------------------- 1 | native.gradle.plugin.version = 0.11.0-SNAPSHOT 2 | junit.jupiter.version = 5.11.0 3 | junit.platform.version = 1.11.0 4 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | plugins { 44 | id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version') 45 | } 46 | } 47 | 48 | rootProject.name = 'java-application' 49 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/src/main/java/org/graalvm/demo/Application.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import java.util.Arrays; 4 | import java.util.stream.Collectors; 5 | 6 | public class Application { 7 | static String getMessage() { 8 | try { 9 | String className = Arrays.asList("org", "graalvm", "demo", "Message").stream().collect(Collectors.joining(".")); 10 | return (String) Class.forName(className).getDeclaredField("MESSAGE").get(null); 11 | } catch (Exception e) { 12 | return null; 13 | } 14 | } 15 | 16 | public static void main(String[] args) { 17 | System.out.println("Application message: " + getMessage()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/src/main/java/org/graalvm/demo/Calculator.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/src/main/java/org/graalvm/demo/Message.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Message { 4 | public static final String MESSAGE = "Hello, native!"; 5 | } 6 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/src/main/resources/META-INF/native-image/jni-config.json: -------------------------------------------------------------------------------- 1 | [ 2 | ] 3 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/src/main/resources/META-INF/native-image/predefined-classes-config.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "type": "agent-extracted", 4 | "classes": [ 5 | 6 | ] 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/src/main/resources/META-INF/native-image/proxy-config.json: -------------------------------------------------------------------------------- 1 | [ 2 | 3 | ] 4 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/src/main/resources/META-INF/native-image/reflect-config.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "DummyClass" 4 | } 5 | ] 6 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/src/main/resources/META-INF/native-image/resource-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "resources": { 3 | "includes": [ 4 | ] 5 | }, 6 | "bundles": [ 7 | 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/src/main/resources/META-INF/native-image/serialization-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lambdaCapturingTypes": [ 3 | 4 | ], 5 | "types": [ 6 | 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/src/main/resources/access-filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": [ 3 | { 4 | "excludeClasses": "org.example.enigma.**" 5 | } 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/src/test/java/org/graalvm/demo/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import org.junit.jupiter.api.DisplayName; 6 | import org.junit.jupiter.api.Test; 7 | 8 | class ApplicationTest { 9 | 10 | @Test 11 | @DisplayName("message is hello native") 12 | void usesReflection() { 13 | assertEquals("Hello, native!", Application.getMessage()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/src/test/java/org/graalvm/demo/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import org.junit.jupiter.api.DisplayName; 6 | import org.junit.jupiter.api.Test; 7 | import org.junit.jupiter.params.ParameterizedTest; 8 | import org.junit.jupiter.params.provider.CsvSource; 9 | 10 | class CalculatorTest { 11 | 12 | @Test 13 | @DisplayName("1 + 1 = 2") 14 | void addsTwoNumbers() { 15 | Calculator calculator = new Calculator(); 16 | assertEquals(2, calculator.add(1, 1), "1 + 1 should equal 2"); 17 | } 18 | 19 | @Test 20 | @DisplayName("1 + 2 = 3") 21 | void addsTwoNumbers2() { 22 | Calculator calculator = new Calculator(); 23 | assertEquals(3, calculator.add(1, 2), "1 + 2 should equal 3"); 24 | } 25 | 26 | @ParameterizedTest(name = "{0} + {1} = {2}") 27 | @CsvSource({ 28 | "0, 1, 1", 29 | "1, 2, 3", 30 | "49, 51, 100", 31 | "1, 100, 101" 32 | }) 33 | void add(int first, int second, int expectedResult) { 34 | Calculator calculator = new Calculator(); 35 | assertEquals(expectedResult, calculator.add(first, second), 36 | () -> first + " + " + second + " should equal " + expectedResult); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/src/test/resources/access-filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": [ 3 | { 4 | "excludeClasses": "org.apache.maven.surefire.**" 5 | } 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /samples/java-application-with-reflection/user-code-filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": [ 3 | {"excludeClasses": "**"}, 4 | {"includeClasses": "org.graalvm.demo.**"}, 5 | {"includeClasses": "org.graalvm.demo.**"} 6 | ] 7 | } -------------------------------------------------------------------------------- /samples/java-application-with-resources/gradle.properties: -------------------------------------------------------------------------------- 1 | native.gradle.plugin.version = 0.11.0-SNAPSHOT 2 | junit.jupiter.version = 5.11.0 3 | junit.platform.version = 1.11.0 4 | -------------------------------------------------------------------------------- /samples/java-application-with-resources/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | plugins { 44 | id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version') 45 | } 46 | } 47 | 48 | rootProject.name = 'java-application' 49 | -------------------------------------------------------------------------------- /samples/java-application-with-resources/src/main/java/org/graalvm/demo/Application.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.IOException; 5 | import java.io.InputStreamReader; 6 | import java.util.List; 7 | import java.util.stream.Collectors; 8 | 9 | public class Application { 10 | public static List getMessages() throws IOException { 11 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(Application.class.getResourceAsStream("/message.txt")))) { 12 | return reader.lines().filter(s -> !s.isEmpty()).collect(Collectors.toList()); 13 | } 14 | } 15 | public static void main(String[] args) throws IOException { 16 | getMessages().forEach(System.out::println); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/java-application-with-resources/src/main/java/org/graalvm/demo/Calculator.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /samples/java-application-with-resources/src/main/resources/message.txt: -------------------------------------------------------------------------------- 1 | Hello, native! 2 | -------------------------------------------------------------------------------- /samples/java-application-with-resources/src/test/java/org/graalvm/demo/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import org.junit.jupiter.api.DisplayName; 6 | import org.junit.jupiter.api.Test; 7 | import org.junit.jupiter.params.ParameterizedTest; 8 | import org.junit.jupiter.params.provider.CsvSource; 9 | 10 | import java.io.BufferedReader; 11 | import java.io.IOException; 12 | import java.io.InputStreamReader; 13 | import java.util.List; 14 | import java.util.stream.Collectors; 15 | 16 | class ApplicationTest { 17 | 18 | public static List getExpectedMessages() throws IOException { 19 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(ApplicationTest.class.getResourceAsStream("expected.txt")))) { 20 | return reader.lines().filter(s -> !s.isEmpty()).collect(Collectors.toList()); 21 | } 22 | } 23 | 24 | @Test 25 | void messageIsFoundOnClasspath() throws IOException { 26 | List messages = Application.getMessages(); 27 | assertEquals(1, messages.size(), "should have a single message"); 28 | assertEquals("Hello, native!", messages.get(0)); 29 | assertEquals(getExpectedMessages(), messages); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /samples/java-application-with-resources/src/test/java/org/graalvm/demo/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import org.junit.jupiter.api.DisplayName; 6 | import org.junit.jupiter.api.Test; 7 | import org.junit.jupiter.params.ParameterizedTest; 8 | import org.junit.jupiter.params.provider.CsvSource; 9 | 10 | class CalculatorTest { 11 | 12 | @Test 13 | @DisplayName("1 + 1 = 2") 14 | void addsTwoNumbers() { 15 | Calculator calculator = new Calculator(); 16 | assertEquals(2, calculator.add(1, 1), "1 + 1 should equal 2"); 17 | } 18 | 19 | @Test 20 | @DisplayName("1 + 2 = 3") 21 | void addsTwoNumbers2() { 22 | Calculator calculator = new Calculator(); 23 | assertEquals(3, calculator.add(1, 2), "1 + 2 should equal 3"); 24 | } 25 | 26 | @ParameterizedTest(name = "{0} + {1} = {2}") 27 | @CsvSource({ 28 | "0, 1, 1", 29 | "1, 2, 3", 30 | "49, 51, 100", 31 | "1, 100, 101" 32 | }) 33 | void add(int first, int second, int expectedResult) { 34 | Calculator calculator = new Calculator(); 35 | assertEquals(expectedResult, calculator.add(first, second), 36 | () -> first + " + " + second + " should equal " + expectedResult); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /samples/java-application-with-resources/src/test/resources/org/graalvm/demo/expected.txt: -------------------------------------------------------------------------------- 1 | Hello, native! 2 | -------------------------------------------------------------------------------- /samples/java-application-with-tests/gradle.properties: -------------------------------------------------------------------------------- 1 | native.gradle.plugin.version = 0.11.0-SNAPSHOT 2 | junit.jupiter.version = 5.11.0 3 | junit.platform.version = 1.11.0 4 | -------------------------------------------------------------------------------- /samples/java-application-with-tests/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | plugins { 44 | id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version') 45 | } 46 | } 47 | 48 | rootProject.name = 'java-application' 49 | -------------------------------------------------------------------------------- /samples/java-application-with-tests/src/main/java/org/graalvm/demo/Application.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Application { 4 | static String getMessage() { 5 | return "Hello, native!"; 6 | } 7 | 8 | public static void main(String[] args) { 9 | System.out.println(getMessage()); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/java-application-with-tests/src/main/java/org/graalvm/demo/Calculator.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Calculator { 4 | 5 | public Calculator() { 6 | if (System.getenv("TEST_ENV") != null) { 7 | System.out.println("TEST_ENV = " + System.getenv("TEST_ENV")); 8 | } 9 | if (System.getProperty("test-property") != null) { 10 | System.out.println("test-property = " + System.getProperty("test-property")); 11 | } 12 | } 13 | 14 | public int add(int a, int b) { 15 | return a + b; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /samples/java-application-with-tests/src/test/java/org/graalvm/demo/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import org.junit.jupiter.api.DisplayName; 6 | import org.junit.jupiter.api.Test; 7 | import org.junit.jupiter.params.ParameterizedTest; 8 | import org.junit.jupiter.params.provider.CsvSource; 9 | 10 | class CalculatorTest { 11 | 12 | @Test 13 | @DisplayName("1 + 1 = 2") 14 | void addsTwoNumbers() { 15 | Calculator calculator = new Calculator(); 16 | assertEquals(2, calculator.add(1, 1), "1 + 1 should equal 2"); 17 | } 18 | 19 | @Test 20 | @DisplayName("1 + 2 = 3") 21 | void addsTwoNumbers2() { 22 | Calculator calculator = new Calculator(); 23 | assertEquals(3, calculator.add(1, 2), "1 + 2 should equal 3"); 24 | } 25 | 26 | @ParameterizedTest(name = "{0} + {1} = {2}") 27 | @CsvSource({ 28 | "0, 1, 1", 29 | "1, 2, 3", 30 | "49, 51, 100", 31 | "1, 100, 101" 32 | }) 33 | void add(int first, int second, int expectedResult) { 34 | Calculator calculator = new Calculator(); 35 | assertEquals(expectedResult, calculator.add(first, second), 36 | () -> first + " + " + second + " should equal " + expectedResult); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /samples/java-application/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | plugins { 43 | id 'application' 44 | id 'org.graalvm.buildtools.native' 45 | } 46 | 47 | application { 48 | mainClass.set('org.graalvm.demo.Application') 49 | } 50 | 51 | repositories { 52 | mavenCentral() 53 | } 54 | 55 | dependencies { 56 | implementation 'org.apache.commons:commons-lang3:3.8.1' 57 | } 58 | -------------------------------------------------------------------------------- /samples/java-application/gradle.properties: -------------------------------------------------------------------------------- 1 | native.gradle.plugin.version = 0.11.0-SNAPSHOT 2 | junit.jupiter.version = 5.11.0 3 | junit.platform.version = 1.11.0 4 | -------------------------------------------------------------------------------- /samples/java-application/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | plugins { 44 | id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version') 45 | } 46 | } 47 | 48 | rootProject.name = 'java-application' 49 | -------------------------------------------------------------------------------- /samples/java-application/src/main/java/org/graalvm/demo/Application.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Application { 4 | private static final String MESSAGE = System.getenv("CUSTOM_MESSAGE"); 5 | 6 | public static void main(String[] args) { 7 | System.out.println(MESSAGE != null ? MESSAGE : "Hello, native!"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/java-library/gradle.properties: -------------------------------------------------------------------------------- 1 | native.gradle.plugin.version = 0.11.0-SNAPSHOT 2 | junit.jupiter.version = 5.11.0 3 | junit.platform.version = 1.11.0 4 | -------------------------------------------------------------------------------- /samples/java-library/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | plugins { 44 | id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version') 45 | } 46 | } 47 | 48 | rootProject.name = 'java-library' 49 | -------------------------------------------------------------------------------- /samples/java-library/src/main/java/org/graalvm/demo/Library.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Library { 4 | public boolean someLibraryMethod() { 5 | return true; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/java-library/src/test/java/org/graalvm/demo/LibraryTest.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import static org.junit.jupiter.api.Assertions.*; 5 | 6 | class LibraryTest { 7 | @Test void testSomeLibraryMethod() { 8 | Library classUnderTest = new Library(); 9 | assertTrue(classUnderTest.someLibraryMethod(), "someLibraryMethod should return 'true'"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/junit-tests/gradle.properties: -------------------------------------------------------------------------------- 1 | native.gradle.plugin.version = 0.11.0-SNAPSHOT 2 | -------------------------------------------------------------------------------- /samples/junit-tests/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025, 2025, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | plugins { 44 | id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version') 45 | } 46 | } 47 | 48 | rootProject.name = 'junit-tests' 49 | -------------------------------------------------------------------------------- /samples/junit-tests/src/test/java/tests/OrderTests.java: -------------------------------------------------------------------------------- 1 | package tests; 2 | 3 | import org.junit.jupiter.api.MethodOrderer; 4 | import org.junit.jupiter.api.Order; 5 | import org.junit.jupiter.api.Test; 6 | import org.junit.jupiter.api.TestMethodOrder; 7 | 8 | import static org.junit.jupiter.api.Assertions.assertNull; 9 | import static org.junit.jupiter.api.Assertions.assertTrue; 10 | 11 | @TestMethodOrder(MethodOrderer.OrderAnnotation.class) 12 | public class OrderTests { 13 | /* tests execution order should be dictated by the @Order annotation */ 14 | protected static String testOrderChecker = "First test"; 15 | 16 | @Test 17 | @Order(2) 18 | void secondTest() { 19 | assertTrue(testOrderChecker.equalsIgnoreCase("Second test")); 20 | testOrderChecker = null; 21 | } 22 | 23 | @Test 24 | @Order(3) 25 | void thirdTest() { 26 | assertNull(testOrderChecker); 27 | } 28 | 29 | @Test 30 | @Order(1) 31 | void firstTest() { 32 | assertTrue(testOrderChecker.equalsIgnoreCase("First test")); 33 | testOrderChecker = "Second test"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /samples/junit-tests/src/test/java/tests/VintageTests.java: -------------------------------------------------------------------------------- 1 | package tests; 2 | 3 | import org.hamcrest.MatcherAssert; 4 | import org.hamcrest.core.Every; 5 | import org.junit.Rule; 6 | import org.junit.Test; 7 | import org.junit.rules.ExpectedException; 8 | 9 | import java.util.Arrays; 10 | import java.util.List; 11 | 12 | import static org.hamcrest.CoreMatchers.instanceOf; 13 | import static org.hamcrest.CoreMatchers.is; 14 | 15 | public class VintageTests { 16 | 17 | /* passes but with some exceptions ("as warning") */ 18 | 19 | @Test 20 | public void testEvery() { 21 | List numbers = Arrays.asList(1, 1, 1, 1); 22 | MatcherAssert.assertThat(numbers, Every.everyItem(is(1))); 23 | } 24 | 25 | @SuppressWarnings("deprecation") 26 | @Rule 27 | public ExpectedException expectedException = ExpectedException.none(); 28 | 29 | @Test 30 | public void testExpectedException() { 31 | expectedException.expect(ArithmeticException.class); 32 | throw new ArithmeticException(); 33 | } 34 | 35 | @Test 36 | public void testExpectedExceptionCause() { 37 | expectedException.expectCause(instanceOf(ArithmeticException.class)); 38 | try { 39 | throw new ArithmeticException(); 40 | } catch (ArithmeticException e) { 41 | throw new RuntimeException(e); 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /samples/junit-tests/src/test/java/tests/common/Fruits.java: -------------------------------------------------------------------------------- 1 | package tests.common; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | public class Fruits { 7 | 8 | private static final List fruits = Arrays.asList("blackberry", "raspberry", "strawberry"); 9 | 10 | public static String getSomeFruit() { 11 | int index = Math.random() > 0.5 ? 1 : 0; 12 | return fruits.get(index); 13 | } 14 | 15 | private String getBlackberry() { 16 | return fruits.get(0); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /samples/junit-tests/src/test/java/tests/common/TestInterface.java: -------------------------------------------------------------------------------- 1 | package tests.common; 2 | 3 | import java.util.List; 4 | 5 | public interface TestInterface { 6 | 7 | static List names() { 8 | return List.of("Sarah", "Susan"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /samples/junit-tests/src/test/resources/resource.txt: -------------------------------------------------------------------------------- 1 | Hello from resource! 2 | -------------------------------------------------------------------------------- /samples/kotlin-application-with-tests/gradle.properties: -------------------------------------------------------------------------------- 1 | native.gradle.plugin.version = 0.11.0-SNAPSHOT 2 | junit.jupiter.version = 5.11.0 3 | junit.platform.version = 1.11.0 4 | -------------------------------------------------------------------------------- /samples/kotlin-application-with-tests/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | plugins { 44 | id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version') 45 | } 46 | } 47 | 48 | rootProject.name = "kotlin-application" 49 | -------------------------------------------------------------------------------- /samples/kotlin-application-with-tests/src/main/kotlin/ktest/App.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This Kotlin source file was generated by the Gradle 'init' task. 3 | */ 4 | package ktest 5 | 6 | class App { 7 | val greeting: String 8 | get() { 9 | return "Hello World!" 10 | } 11 | } 12 | 13 | fun main() { 14 | println(App().greeting) 15 | } 16 | -------------------------------------------------------------------------------- /samples/kotlin-application-with-tests/src/test/kotlin/ktest/AppTest.kt: -------------------------------------------------------------------------------- 1 | package ktest 2 | 3 | import kotlin.test.Test 4 | import kotlin.test.assertNotNull 5 | 6 | class AppTest { 7 | @Test fun testAppHasAGreeting() { 8 | val classUnderTest = App() 9 | assertNotNull(classUnderTest.greeting, "app should have a greeting") 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/layered-java-application/gradle.properties: -------------------------------------------------------------------------------- 1 | native.gradle.plugin.version = 0.10.7-SNAPSHOT 2 | junit.jupiter.version = 5.10.0 3 | junit.platform.version = 1.10.0 4 | -------------------------------------------------------------------------------- /samples/layered-java-application/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | plugins { 44 | id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version') 45 | } 46 | } 47 | 48 | rootProject.name = 'layered-java-application' 49 | -------------------------------------------------------------------------------- /samples/layered-java-application/src/main/java/org/graalvm/demo/Application.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import java.util.Arrays; 6 | 7 | public class Application { 8 | private static final Logger LOGGER = LoggerFactory.getLogger(Application.class); 9 | 10 | public static void main(String[] args) { 11 | LOGGER.info("App started with args {}", Arrays.asList(args)); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /samples/layered-mn-application/gradle.properties: -------------------------------------------------------------------------------- 1 | micronautVersion=4.8.1 2 | native.gradle.plugin.version = 0.10.7-SNAPSHOT 3 | -------------------------------------------------------------------------------- /samples/layered-mn-application/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | mavenCentral() 5 | } 6 | plugins { 7 | id("io.micronaut.minimal.application") version "4.5.3" 8 | id("io.micronaut.graalvm") version "4.5.3" 9 | id("org.graalvm.buildtools.native") version(getProperty("native.gradle.plugin.version")) 10 | } 11 | } 12 | 13 | rootProject.name = "layered-mn-app" 14 | -------------------------------------------------------------------------------- /samples/layered-mn-application/src/main/java/layered/mn/app/Application.java: -------------------------------------------------------------------------------- 1 | package layered.mn.app; 2 | 3 | import io.micronaut.runtime.Micronaut; 4 | 5 | public class Application { 6 | 7 | public static void main(String[] args) { 8 | Micronaut.run(Application.class, args); 9 | } 10 | } -------------------------------------------------------------------------------- /samples/layered-mn-application/src/main/java/layered/mn/app/HelloController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package layered.mn.app; 17 | 18 | import io.micronaut.http.MediaType; 19 | import io.micronaut.http.annotation.Controller; 20 | import io.micronaut.http.annotation.Get; 21 | import io.micronaut.http.annotation.Produces; 22 | 23 | @Controller 24 | public class HelloController { 25 | @Get("/") 26 | @Produces(MediaType.TEXT_PLAIN) 27 | public String sayHello() { 28 | return sayHello("layered images"); 29 | } 30 | 31 | @Get("/{name}") 32 | @Produces(MediaType.TEXT_PLAIN) 33 | public String sayHello(String name) { 34 | return "Hello, "+ name + "!"; 35 | } 36 | 37 | @Get("/bye/{name}") 38 | @Produces(MediaType.TEXT_PLAIN) 39 | public String sayBye(String name) { 40 | return "Bye, "+ name + "!"; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /samples/layered-mn-application/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Mon Mar 10 16:06:16 CET 2025 2 | micronaut.application.name=layered-mn-app 3 | -------------------------------------------------------------------------------- /samples/layered-mn-application/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | %cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/layered-mn-application/src/test/java/layered/mn/app/LayeredMnAppTest.java: -------------------------------------------------------------------------------- 1 | package layered.mn.app; 2 | 3 | import io.micronaut.runtime.EmbeddedApplication; 4 | import io.micronaut.test.extensions.junit5.annotation.MicronautTest; 5 | import org.junit.jupiter.api.Test; 6 | import org.junit.jupiter.api.Assertions; 7 | 8 | import jakarta.inject.Inject; 9 | 10 | @MicronautTest 11 | class LayeredMnAppTest { 12 | 13 | @Inject 14 | EmbeddedApplication application; 15 | 16 | @Test 17 | void testItWorks() { 18 | Assertions.assertTrue(application.isRunning()); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /samples/metadata-repo-integration/.gitignore: -------------------------------------------------------------------------------- 1 | /data -------------------------------------------------------------------------------- /samples/metadata-repo-integration/gradle.properties: -------------------------------------------------------------------------------- 1 | native.gradle.plugin.version = 0.11.0-SNAPSHOT 2 | h2.version = 2.2.220 3 | netty.version = 4.1.80.Final 4 | logback.version = 1.4.4 5 | log4j.version = 2.19.0 6 | slf4j.version = 2.0.3 7 | -------------------------------------------------------------------------------- /samples/metadata-repo-integration/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | plugins { 3 | id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version') 4 | } 5 | } 6 | 7 | rootProject.name = 'metadata-repo-demo' 8 | -------------------------------------------------------------------------------- /samples/metadata-repo-integration/src/main/java/org/graalvm/example/Example.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.example; 2 | 3 | public class Example { 4 | 5 | public static void main(String[] args) throws Exception { 6 | H2Example.test(); 7 | NettyExample.test(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/metadata-repo-integration/src/main/java/org/graalvm/example/NettyExample.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.example; 2 | 3 | import io.netty.handler.codec.http.cookie.ServerCookieDecoder; 4 | 5 | public class NettyExample { 6 | 7 | public static void test() { 8 | ServerCookieDecoder.STRICT.decode(""); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /samples/multi-project-with-tests/core/src/main/java/org/graalvm/demo/Application.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | public class Application { 4 | static String getMessage() { 5 | return "Hello, native!"; 6 | } 7 | 8 | public static void main(String[] args) { 9 | System.out.println(getMessage()); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/multi-project-with-tests/core/src/test/java/org/graalvm/demo/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import org.junit.jupiter.api.DisplayName; 7 | import org.junit.jupiter.api.Test; 8 | import org.junit.jupiter.params.ParameterizedTest; 9 | import org.junit.jupiter.params.provider.CsvSource; 10 | import org.apache.commons.math3.complex.Complex; 11 | 12 | import java.io.IOException; 13 | import java.io.FileInputStream; 14 | 15 | class CalculatorTest { 16 | 17 | @Test 18 | @DisplayName("1 + 1 = 2") 19 | void addsTwoNumbers() { 20 | Calculator calculator = new Calculator(); 21 | assertEquals(2, calculator.add(1, 1), "1 + 1 should equal 2"); 22 | } 23 | 24 | @Test 25 | @DisplayName("1 + 2 = 3") 26 | void addsTwoNumbers2() { 27 | Calculator calculator = new Calculator(); 28 | assertEquals(3, calculator.add(1, 2), "1 + 2 should equal 3"); 29 | } 30 | 31 | @Test 32 | @DisplayName("I == complex(0, 1)") 33 | void createComplexNumber() { 34 | Calculator calculator = new Calculator(); 35 | assertEquals(Complex.I, calculator.complex(0, 1), "complex(0,1) should equal I"); 36 | } 37 | 38 | @ParameterizedTest(name = "{0} + {1} = {2}") 39 | @CsvSource({ 40 | "0, 1, 1", 41 | "1, 2, 3", 42 | "49, 51, 100", 43 | "1, 100, 101" 44 | }) 45 | void add(int first, int second, int expectedResult) { 46 | Calculator calculator = new Calculator(); 47 | assertEquals(expectedResult, calculator.add(first, second), 48 | () -> first + " + " + second + " should equal " + expectedResult); 49 | } 50 | 51 | @Test 52 | void messageIsFoundUsingRelativePaths() throws IOException { 53 | try (FileInputStream fileInputStream = new FileInputStream("src/test/resources/hello.txt")) { 54 | assertNotNull(fileInputStream); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /samples/multi-project-with-tests/core/src/test/resources/hello.txt: -------------------------------------------------------------------------------- 1 | Hello! 2 | -------------------------------------------------------------------------------- /samples/multi-project-with-tests/gradle.properties: -------------------------------------------------------------------------------- 1 | native.gradle.plugin.version = 0.11.0-SNAPSHOT 2 | junit.jupiter.version = 5.11.0 3 | junit.platform.version = 1.11.0 4 | -------------------------------------------------------------------------------- /samples/multi-project-with-tests/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | plugins { 44 | id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version') 45 | } 46 | } 47 | 48 | rootProject.name = 'java-application' 49 | 50 | include 'core' 51 | include 'utils' 52 | -------------------------------------------------------------------------------- /samples/multi-project-with-tests/utils/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | plugins { 43 | id 'java-library' 44 | } 45 | 46 | repositories { 47 | mavenCentral() 48 | } 49 | 50 | dependencies { 51 | api "org.apache.commons:commons-math3:3.6.1" 52 | } 53 | -------------------------------------------------------------------------------- /samples/multi-project-with-tests/utils/src/main/java/org/graalvm/demo/Calculator.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.demo; 2 | 3 | import org.apache.commons.math3.complex.Complex; 4 | 5 | public class Calculator { 6 | 7 | public int add(int a, int b) { 8 | return a + b; 9 | } 10 | 11 | public Complex complex(double real, double imaginary) { 12 | return new Complex(real, imaginary); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /samples/native-config-integration/config-directory/index.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /samples/native-config-integration/config-directory/org.graalvm.internal/library-with-reflection/1/reflect-config.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "org.graalvm.internal.reflect.Message", 4 | "allDeclaredFields": true, 5 | "allDeclaredMethods": true 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /samples/native-config-integration/config-directory/org.graalvm.internal/library-with-reflection/index.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "module": "org.graalvm.internal:library-with-reflection", 4 | "tested-versions": [ 5 | "1.0", 6 | "1.1", 7 | "1.2", 8 | "1.3" 9 | ], 10 | "metadata-version": "1", 11 | "latest": true 12 | } 13 | ] 14 | -------------------------------------------------------------------------------- /samples/native-config-integration/gradle.properties: -------------------------------------------------------------------------------- 1 | native.gradle.plugin.version = 0.11.0-SNAPSHOT 2 | junit.jupiter.version = 5.11.0 3 | junit.platform.version = 1.11.0 4 | -------------------------------------------------------------------------------- /samples/native-config-integration/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * The Universal Permissive License (UPL), Version 1.0 6 | * 7 | * Subject to the condition set forth below, permission is hereby granted to any 8 | * person obtaining a copy of this software, associated documentation and/or 9 | * data (collectively the "Software"), free of charge and under any and all 10 | * copyright rights in the Software, and any and all patent rights owned or 11 | * freely licensable by each licensor hereunder covering either (i) the 12 | * unmodified Software as contributed to or provided by such licensor, or (ii) 13 | * the Larger Works (as defined below), to deal in both 14 | * 15 | * (a) the Software, and 16 | * 17 | * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | * one is included with the Software each a "Larger Work" to which the Software 19 | * is contributed by such licensors), 20 | * 21 | * without restriction, including without limitation the rights to copy, create 22 | * derivative works of, display, perform, and distribute the Software and make, 23 | * use, sell, offer for sale, import, export, have made, and have sold the 24 | * Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | * either these or other terms. 26 | * 27 | * This license is subject to the following condition: 28 | * 29 | * The above copyright notice and either this complete permission notice or at a 30 | * minimum a reference to the UPL must be included in all copies or substantial 31 | * portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | pluginManagement { 43 | plugins { 44 | id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version') 45 | } 46 | } 47 | 48 | rootProject.name = 'native-config-integration' 49 | -------------------------------------------------------------------------------- /samples/native-config-integration/src/main/java/org/graalvm/example/Application.java: -------------------------------------------------------------------------------- 1 | package org.graalvm.example; 2 | 3 | import org.graalvm.internal.reflect.Greeter; 4 | 5 | public class Application { 6 | public static void main(String[] args) { 7 | Greeter greeter = new Greeter(); 8 | greeter.greet(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test-support/library-with-reflection/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `java-library` 3 | id("org.graalvm.build.publishing") 4 | } 5 | 6 | group = "org.graalvm.internal" 7 | version = "1.5" 8 | 9 | java { 10 | toolchain { 11 | languageVersion.set(JavaLanguageVersion.of(17)) 12 | } 13 | } 14 | 15 | publishing { 16 | publications { 17 | create("maven") { 18 | from(components["java"]) 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test-support/library-with-reflection/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | includeBuild("../../build-logic/common-plugins") 3 | } 4 | 5 | rootProject.name = "library-with-reflection" 6 | -------------------------------------------------------------------------------- /test-support/library-with-reflection/src/main/java/org/graalvm/internal/reflect/Greeter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.graalvm.internal.reflect; 17 | 18 | import java.lang.reflect.InvocationTargetException; 19 | import java.lang.reflect.Method; 20 | import java.util.Optional; 21 | 22 | public class Greeter { 23 | private String message; 24 | 25 | public String getMessage() { 26 | return message; 27 | } 28 | 29 | public void setMessage(String message) { 30 | this.message = message; 31 | } 32 | 33 | public void greet() { 34 | System.out.println(Optional.ofNullable(message).orElseGet(() -> { 35 | String msg = defaultMessage(); 36 | if (msg == null) { 37 | return "Reflection failed"; 38 | } 39 | return msg; 40 | })); 41 | } 42 | 43 | private String defaultMessage() { 44 | Method method; 45 | try { 46 | method = Class.forName(System.getProperty("messageClass")).getDeclaredMethod("getDefault"); 47 | return (String) method.invoke(null); 48 | } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | ClassNotFoundException e) { 49 | return null; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /test-support/library-with-reflection/src/main/java/org/graalvm/internal/reflect/Message.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.graalvm.internal.reflect; 17 | 18 | public class Message { 19 | public static String getDefault() { 20 | return "Hello, from reflection!"; 21 | } 22 | } 23 | --------------------------------------------------------------------------------