From a00424f27bc0f33b24eb2a5965b437dd0efaf95e Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Tue, 13 Dec 2022 10:35:50 +0100 Subject: [PATCH] Adding documentation generation --- CHANGELOG.md | 4 ++++ docs/readme.txt | 1 + pom.xml | 8 +++++++- .../documentation/ISMDiscoveryForDocumentation.java | 11 +++++++---- 4 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 docs/readme.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index e59f61f..036873c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for gCube Model +## [v4.0.1-SNAPSHOT] + +- Adding documentation generation + ## [v4.0.0] - Aligned model with the model defined in Luca Frosini PhD dissertation [#20367] diff --git a/docs/readme.txt b/docs/readme.txt new file mode 100644 index 0000000..338e03b --- /dev/null +++ b/docs/readme.txt @@ -0,0 +1 @@ +In this directory will be automatically created the documentation \ No newline at end of file diff --git a/pom.xml b/pom.xml index d67a275..fc9efc8 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.gcube.resource-management gcube-model - 4.0.0 + 4.0.1-SNAPSHOT gCube Resources gCube Model is a resource model built on top of IS Model which captures the different aspects of the resources and their relations playing significant roles in a research infrastructure empowered by gCube jar @@ -71,5 +71,11 @@ logback-classic test + + org.gcube.information-system + information-system-model-documentation-generator + [1.0.0-SNAPSHOT,2.0.0-SNAPSHOT) + test + \ No newline at end of file diff --git a/src/test/java/org/gcube/resourcemanagement/documentation/ISMDiscoveryForDocumentation.java b/src/test/java/org/gcube/resourcemanagement/documentation/ISMDiscoveryForDocumentation.java index c91da6b..d6bf487 100644 --- a/src/test/java/org/gcube/resourcemanagement/documentation/ISMDiscoveryForDocumentation.java +++ b/src/test/java/org/gcube/resourcemanagement/documentation/ISMDiscoveryForDocumentation.java @@ -1,7 +1,7 @@ package org.gcube.resourcemanagement.documentation; import java.io.File; -import java.net.URL; +import java.util.List; import org.gcube.informationsystem.utils.documentation.DocumentationGenerator; import org.gcube.resourcemanagement.model.impl.GCubeModelRegistrationProvider; @@ -18,9 +18,12 @@ public class ISMDiscoveryForDocumentation { @Test public void generateDocumentation() throws Exception { - URL directoryURL = GCubeModelRegistrationProvider.class.getClassLoader().getResource("docs"); - File documentationDirectory = new File(directoryURL.toURI()); + File documentationDirectory = new File("docs"); DocumentationGenerator documentationGenerator = new DocumentationGenerator(documentationDirectory); - documentationGenerator.generate(); + +// Type type = TypeMapper.createTypeDefinition(ValueSchema.class); +// documentationGenerator.generatePropertySection(type); + List pkgs = (new GCubeModelRegistrationProvider()).getPackagesToRegister(); + documentationGenerator.generate(pkgs); } }