Skip to content

Commit

Permalink
Terminology changes: native configuration -> JVM reachability metadata
Browse files Browse the repository at this point in the history
This commit updates the native configuration project according to the
latest approved terminology: we're talking about JVM reachability metadata.
The extension is now:

```gradle
graalvmNative {
    jvmReachabilityMetadataRepository {
        ...
    }
}
```
  • Loading branch information
melix committed Mar 16, 2022
1 parent d4ccf6b commit 7df6adc
Show file tree
Hide file tree
Showing 53 changed files with 74 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Native Configuration Repository
on:
push:
paths:
- 'common/native-config/**'
- 'common/jvm-reachability-metadata/**'
pull_request:
paths:
- 'common/native-config/**'
- 'common/jvm-reachability-metadata/**'
workflow_dispatch:

jobs:
Expand All @@ -26,12 +26,12 @@ jobs:
echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
echo "GRAALVM_HOME=$GRAALVM_HOME" >> $GITHUB_ENV
- name: Checkstyle
run: ./gradlew :native-config:checkstyleMain :native-config:checkstyleTest
run: ./gradlew :jvm-reachability-metadata:checkstyleMain :jvm-reachability-metadata:checkstyleTest
- name: JVM test
run: ./gradlew :native-config:test
run: ./gradlew :jvm-reachability-metadata:test
- name: Tests results
if: always()
uses: actions/upload-artifact@v2
with:
name: tests-results
path: common/native-config/build/reports/tests/
path: common/jvm-reachability-metadata/build/reports/tests/
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ plugins {
}

maven {
name.set("GraalVM Native Configuration support")
description.set("A library to help dealing with the GraaVM native configuration repository")
name.set("GraalVM JVM Reachability Metadata support")
description.set("A library to help dealing with the GraaVM JVM Reachability Metadata repository")
}

dependencies {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ plugins {
id("org.graalvm.build.common")
}

rootProject.name = "native-config"
rootProject.name = "jvm-reachability-metadata"
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.nativeconfig;
package org.graalvm.reachability;

import java.nio.file.Path;
import java.util.Collection;
import java.util.Set;
import java.util.function.Consumer;

/**
* Interface for accessing a native configuration repository.
* Interface for accessing a reachability metadata repository.
* The goal of this repository is to answer questions like:
* "give me the configuration files for this artifact", where
* an artifact is represented by its GAV coordinates.
Expand All @@ -55,7 +55,7 @@
* and provide overrides for cases where configuration files
* are missing.
*/
public interface NativeConfigurationRepository {
public interface JvmReachabilityMetadataRepository {
/**
* Performs a generic query on the repository, returning a list of
* configuration directories. The query may be parameterized with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.nativeconfig;
package org.graalvm.reachability;

import java.util.Collection;
import java.util.function.Consumer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.nativeconfig.internal;
package org.graalvm.reachability.internal;

import org.graalvm.nativeconfig.Query;
import org.graalvm.reachability.Query;

import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.nativeconfig.internal;
package org.graalvm.reachability.internal;

import org.graalvm.nativeconfig.Query;
import org.graalvm.reachability.Query;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.nativeconfig.internal;
package org.graalvm.reachability.internal;

import org.graalvm.nativeconfig.NativeConfigurationRepository;
import org.graalvm.nativeconfig.Query;
import org.graalvm.nativeconfig.internal.index.artifacts.SingleModuleJsonVersionToConfigDirectoryIndex;
import org.graalvm.nativeconfig.internal.index.artifacts.VersionToConfigDirectoryIndex;
import org.graalvm.nativeconfig.internal.index.modules.FileSystemModuleToConfigDirectoryIndex;
import org.graalvm.reachability.JvmReachabilityMetadataRepository;
import org.graalvm.reachability.Query;
import org.graalvm.reachability.internal.index.artifacts.SingleModuleJsonVersionToConfigDirectoryIndex;
import org.graalvm.reachability.internal.index.artifacts.VersionToConfigDirectoryIndex;
import org.graalvm.reachability.internal.index.modules.FileSystemModuleToConfigDirectoryIndex;

import java.nio.file.Path;
import java.util.Map;
Expand All @@ -55,7 +55,7 @@
import java.util.function.Supplier;
import java.util.stream.Collectors;

public class FileSystemRepository implements NativeConfigurationRepository {
public class FileSystemRepository implements JvmReachabilityMetadataRepository {
private final FileSystemModuleToConfigDirectoryIndex moduleIndex;
private final Logger logger;
private final Map<Path, VersionToConfigDirectoryIndex> artifactIndexes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.nativeconfig.internal;
package org.graalvm.reachability.internal;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.nativeconfig.internal.index.artifacts;
package org.graalvm.reachability.internal.index.artifacts;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.nativeconfig.internal.index.artifacts;
package org.graalvm.reachability.internal.index.artifacts;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.type.TypeFactory;
import org.graalvm.nativeconfig.internal.UncheckedIOException;
import org.graalvm.reachability.internal.UncheckedIOException;

import java.io.BufferedReader;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.nativeconfig.internal.index.artifacts;
package org.graalvm.reachability.internal.index.artifacts;

import java.nio.file.Path;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.nativeconfig.internal.index.modules;
package org.graalvm.reachability.internal.index.modules;

import java.nio.file.Path;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.nativeconfig.internal.index.modules;
package org.graalvm.reachability.internal.index.modules;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.type.TypeFactory;
import org.graalvm.nativeconfig.internal.UncheckedIOException;
import org.graalvm.reachability.internal.UncheckedIOException;

import java.io.BufferedReader;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.nativeconfig.internal.index.modules;
package org.graalvm.reachability.internal.index.modules;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.nativeconfig.internal.index.modules;
package org.graalvm.reachability.internal.index.modules;

import java.nio.file.Path;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.nativeconfig.internal.index.modules;
package org.graalvm.reachability.internal.index.modules;

import java.nio.file.Files;
import java.nio.file.Path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
* SOFTWARE.
*/

package org.graalvm.nativeconfig.internal;
package org.graalvm.reachability.internal;

import org.graalvm.nativeconfig.Query;
import org.graalvm.reachability.Query;
import org.junit.jupiter.api.Test;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* SOFTWARE.
*/

package org.graalvm.nativeconfig.internal.index.artifacts;
package org.graalvm.reachability.internal.index.artifacts;

import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* SOFTWARE.
*/

package org.graalvm.nativeconfig.internal.index.modules;
package org.graalvm.reachability.internal.index.modules;

import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* SOFTWARE.
*/

package org.graalvm.nativeconfig.internal.index.modules;
package org.graalvm.reachability.internal.index.modules;

import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* SOFTWARE.
*/

package org.graalvm.nativeconfig.internal.index.modules;
package org.graalvm.reachability.internal.index.modules;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ nativeGradlePlugin = { module = "org.graalvm.buildtools:native-gradle-plugin", v
nativeMavenPlugin = { module = "org.graalvm.buildtools:native-maven-plugin", version.ref = "nativeBuildTools" }
junitPlatformNative = { module = "org.graalvm.buildtools:junit-platform-native", version.ref = "nativeBuildTools" }
utils = { module = "org.graalvm.buildtools:utils", version.ref = "nativeBuildTools" }
nativeConfig = { module = "org.graalvm.buildtools:native-config", version.ref = "nativeBuildTools" }
jvmReachabilityMetadata = { module = "org.graalvm.buildtools:jvm-reachability-metadata", version.ref = "nativeBuildTools" }

# External dependencies
test-junit-platform-console = { module = "org.junit.platform:junit-platform-console", version.ref = "junitPlatform" }
Expand Down
2 changes: 1 addition & 1 deletion native-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ maven {

dependencies {
implementation libs.utils
implementation libs.nativeConfig
implementation libs.jvmReachabilityMetadata
testImplementation libs.test.spock
testFixturesImplementation libs.test.spock
testFixturesImplementation gradleTestKit()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ class NativeConfigRepoFunctionalTest extends AbstractFunctionalTest {
outputContains "Hello, from reflection!"

and: "doesn't find a configuration directory for the current version"
outputContains "[configuration repository for org.graalvm.internal:library-with-reflection:1.5]: Configuration directory not found. Trying latest version."
outputContains "[jvm reachability metadata repository for org.graalvm.internal:library-with-reflection:1.5]: Configuration directory not found. Trying latest version."

and: "but finds one thanks to the latest configuration field"
outputContains "[configuration repository for org.graalvm.internal:library-with-reflection:1.5]: Configuration directory is org/graalvm/internal/library-with-reflection/1"
outputContains "[jvm reachability metadata repository for org.graalvm.internal:library-with-reflection:1.5]: Configuration directory is org/graalvm/internal/library-with-reflection/1"

where:
format | label
Expand All @@ -94,7 +94,7 @@ class NativeConfigRepoFunctionalTest extends AbstractFunctionalTest {

buildFile << """
graalvmNative {
configurationRepository {
jvmReachabilityMetadataRepository {
excludedModules.add("org.graalvm.internal:library-with-reflection")
}
}
Expand All @@ -112,7 +112,7 @@ graalvmNative {
outputContains "Reflection failed"

and: "doesn't look for a configuration directory for the current version"
outputDoesNotContain "[configuration repository for org.graalvm.internal:library-with-reflection:1.5]: Configuration directory not found. Trying latest version."
outputDoesNotContain "[jvm reachability metadata repository for org.graalvm.internal:library-with-reflection:1.5]: Configuration directory not found. Trying latest version."
}

def "can force a dependency to a specific config version"() {
Expand All @@ -121,7 +121,7 @@ graalvmNative {

buildFile << """
graalvmNative {
configurationRepository {
jvmReachabilityMetadataRepository {
moduleToConfigVersion.put("org.graalvm.internal:library-with-reflection", "2")
}
}
Expand All @@ -139,7 +139,7 @@ graalvmNative {
outputContains "Reflection failed"

and: "looks for specific configuration version"
outputContains "[configuration repository for org.graalvm.internal:library-with-reflection:1.5]: Configuration is forced to version 2"
outputContains "[jvm reachability metadata repository for org.graalvm.internal:library-with-reflection:1.5]: Configuration is forced to version 2"
}

}

0 comments on commit 7df6adc

Please sign in to comment.