Skip to content

Commit

Permalink
refactor: move the runtime-metamodel module in its own repo (#164)
Browse files Browse the repository at this point in the history
* refactor: move the runtime-metamodel module in its own repo

* removed remnants, amended repos
  • Loading branch information
paullatzelsperger committed Jun 26, 2023
1 parent 82b00e4 commit 92c61d8
Show file tree
Hide file tree
Showing 39 changed files with 22 additions and 1,335 deletions.
1 change: 0 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ README.md @paullatzelsperger
.github/ISSUE_TEMPLATE @paullatzelsperger
.github/workflows/ @paullatzelsperger

/runtime-metamodel/ @paullatzelsperger @jimmarino
/plugins/autodoc/autodoc-core/ @paullatzelsperger @jimmarino
/plugins/autodoc/autodoc-extension-test/ @paullatzelsperger @jimmarino
/plugins/autodoc/autodoc-spi-test/ @paullatzelsperger @jimmarino
Expand Down
8 changes: 7 additions & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ group = "org.eclipse.edc"

repositories {
mavenCentral()
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
gradlePluginPortal()
mavenLocal()
}

dependencies {
Expand All @@ -23,6 +27,9 @@ dependencies {
implementation(libs.jackson.annotations)
implementation(libs.jackson.databind)
implementation(libs.jackson.datatypeJsr310)

api(libs.edc.runtime.metamodel)

}

gradlePlugin {
Expand All @@ -38,7 +45,6 @@ sourceSets {
main {
java {
srcDirs(
"../runtime-metamodel/src/main",
"../plugins/autodoc/autodoc-plugin/src/main",
"../plugins/autodoc/autodoc-processor/src/main",
"../plugins/edc-build/src/main",
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
format.version = "1.1"

[versions]
edc = "0.1.3-SNAPSHOT"
jackson = "2.15.2"
jetbrainsAnnotation = "24.0.1"

[libraries]
edc-runtime-metamodel = { module = "org.eclipse.edc:runtime-metamodel", version.ref = "edc" }
jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson" }
jackson-core = { module = "com.fasterxml.jackson.core:jackson-core", version.ref = "jackson" }
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
Expand Down
2 changes: 1 addition & 1 deletion plugins/autodoc/autodoc-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

dependencies {
implementation(project(":runtime-metamodel"))
implementation(libs.edc.runtime.metamodel)
implementation(libs.jetbrains.annotations)
implementation(libs.jackson.core)
implementation(libs.jackson.annotations)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
public class AutodocPlugin implements Plugin<Project> {

private final List<String> exclusions = List.of("runtime-metamodel", "version-catalog", "edc-build", "module-names", "openapi-merger", "test-summary", "autodoc-plugin", "autodoc-processor");
private final List<String> exclusions = List.of("version-catalog", "edc-build", "module-names", "openapi-merger", "test-summary", "autodoc-plugin", "autodoc-processor");

@Override
public void apply(Project project) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/autodoc/autodoc-processor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ plugins {
}

dependencies {
api(project(":runtime-metamodel"))
api(libs.edc.runtime.metamodel)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
package org.eclipse.edc.plugins.autodoc.core.processor.introspection;

import org.eclipse.edc.plugins.autodoc.core.processor.compiler.AnnotationFunctions;
import org.eclipse.edc.runtime.metamodel.annotation.EdcSetting;
import org.eclipse.edc.runtime.metamodel.annotation.EdcSettingContext;
import org.eclipse.edc.runtime.metamodel.annotation.Extension;
import org.eclipse.edc.runtime.metamodel.annotation.Inject;
import org.eclipse.edc.runtime.metamodel.annotation.Provider;
Expand Down Expand Up @@ -103,8 +101,7 @@ public List<Service> resolveProvidedServices(Element element) {
* Resolves configuration points declared with {@link Setting}.
*/
public List<ConfigurationSetting> resolveConfigurationSettings(Element element) {
return Stream.concat(getEnclosedElementsAnnotatedWith(element, EdcSetting.class),
getEnclosedElementsAnnotatedWith(element, Setting.class))
return getEnclosedElementsAnnotatedWith(element, Setting.class)
.filter(VariableElement.class::isInstance)
.map(VariableElement.class::cast)
.map(this::createConfigurationSetting)
Expand Down Expand Up @@ -141,9 +138,6 @@ private ConfigurationSetting createConfigurationSetting(VariableElement settingE
var settingBuilder = ConfigurationSetting.Builder.newInstance().key(keyValue);

var settingMirror = mirrorFor(Setting.class, settingElement);
if (settingMirror == null) { //todo: compatibility
settingMirror = mirrorFor(EdcSetting.class, settingElement);
}

var description = attributeValue(String.class, "value", settingMirror, elementUtils);
settingBuilder.description(description);
Expand All @@ -164,7 +158,7 @@ private ConfigurationSetting createConfigurationSetting(VariableElement settingE
}

/**
* Resolves a configuration prefix specified by {@link EdcSettingContext} for a given EDC setting element or an empty string if there is none.
* Resolves a configuration prefix specified by {@link SettingContext} for a given EDC setting element or an empty string if there is none.
*/
@NotNull
private String resolveConfigurationPrefix(VariableElement edcSettingElement) {
Expand All @@ -173,9 +167,6 @@ private String resolveConfigurationPrefix(VariableElement edcSettingElement) {
return "";
}
var contextMirror = mirrorFor(SettingContext.class, enclosingElement);
if (contextMirror == null) {
contextMirror = mirrorFor(EdcSettingContext.class, enclosingElement);
}
return contextMirror != null ? attributeValue(String.class, "value", contextMirror, elementUtils) : "";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

package org.eclipse.edc.plugins.autodoc.core.processor.introspection;

import org.eclipse.edc.runtime.metamodel.annotation.EdcSetting;
import org.eclipse.edc.runtime.metamodel.annotation.Extension;
import org.eclipse.edc.runtime.metamodel.annotation.ExtensionPoint;
import org.eclipse.edc.runtime.metamodel.annotation.Inject;
Expand Down Expand Up @@ -80,7 +79,6 @@ public String getModuleName(RoundEnvironment environment) {
* <li>Are annotated with {@link Provides}</li>
* <li>Are annotated with {@link Requires}</li>
* <li>Have one or more fields annotated with {@link Inject}</li>
* <li>Have one or more fields annotated with {@link EdcSetting}</li>
* <li>Have one or more methods annotated with {@link Provider}</li>
* </ul>
* <p>
Expand All @@ -92,14 +90,13 @@ public String getModuleName(RoundEnvironment environment) {
*/
public Set<Element> getExtensionElements(RoundEnvironment environment) {
var extensionClasses = environment.getElementsAnnotatedWith(Extension.class);
var settingsSymbolsDeprecated = environment.getElementsAnnotatedWith(EdcSetting.class);
var settingsSymbols = environment.getElementsAnnotatedWith(Setting.class);
var injectSymbols = environment.getElementsAnnotatedWith(Inject.class);
var providerSymbols = environment.getElementsAnnotatedWith(Provider.class);
var providesClasses = environment.getElementsAnnotatedWith(Provides.class);
var requiresClasses = environment.getElementsAnnotatedWith(Requires.class);

var symbols = Stream.concat(settingsSymbols.stream(), settingsSymbolsDeprecated.stream());
var symbols = settingsSymbols.stream();
symbols = Stream.concat(symbols, injectSymbols.stream());
symbols = Stream.concat(symbols, providerSymbols.stream());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
package org.eclipse.edc.plugins.autodoc.core.processor.testextensions;

import org.eclipse.edc.plugins.autodoc.core.processor.Constants;
import org.eclipse.edc.runtime.metamodel.annotation.EdcSetting;
import org.eclipse.edc.runtime.metamodel.annotation.Inject;
import org.eclipse.edc.runtime.metamodel.annotation.Provider;
import org.eclipse.edc.runtime.metamodel.annotation.Provides;
import org.eclipse.edc.runtime.metamodel.annotation.Setting;
import org.eclipse.edc.spi.system.ServiceExtension;

@Provides(SomeOtherService.class)
public class SampleExtensionWithoutAnnotation implements ServiceExtension {
@EdcSetting(value = Constants.TEST_SETTING_NAME, required = true)
@Setting(value = Constants.TEST_SETTING_NAME, required = true)
public static final String TEST_SETTING = Constants.TEST_SETTING_KEY;

@Inject
Expand Down
2 changes: 1 addition & 1 deletion plugins/edc-build/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ repositories {
}

dependencies {
implementation(project(":runtime-metamodel"))
implementation(project(":plugins:autodoc:autodoc-plugin"))
implementation(project(":plugins:test-summary"))
implementation(project(":plugins:module-names"))
implementation(project(":plugins:openapi-merger"))

implementation(libs.edc.runtime.metamodel)
implementation(libs.plugin.dependency.analysis)
implementation(libs.plugin.nexus.publish)
implementation(libs.plugin.checksum)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ public void apply(Project target) {
"org.assertj:assertj-core",
"org.junit.jupiter:junit-jupiter-api",
"org.junit.jupiter:junit-jupiter-params",
"org.mockito:mockito-core",
"org.eclipse.edc:runtime-metamodel"
"org.mockito:mockito-core"
));
a.onIncorrectConfiguration(i -> i.exclude(
// some common dependencies are intentionally exported by core:common:connector-core for simplicity
Expand Down
2 changes: 1 addition & 1 deletion plugins/module-names/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ gradlePlugin {
}

dependencies {
implementation(project(":runtime-metamodel"))
implementation(libs.edc.runtime.metamodel)
}
2 changes: 1 addition & 1 deletion plugins/openapi-merger/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {
// needed for the OpenApiDataInvalidException:
implementation(libs.plugin.openapi.merger.app)

implementation(project(":runtime-metamodel"))
implementation(libs.edc.runtime.metamodel)

}

Expand Down
2 changes: 1 addition & 1 deletion plugins/test-summary/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ gradlePlugin {
}

dependencies {
implementation(project(":runtime-metamodel"))
implementation(libs.edc.runtime.metamodel)
}
12 changes: 0 additions & 12 deletions runtime-metamodel/build.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 92c61d8

Please sign in to comment.