Skip to content

Commit 332795d

Browse files
authored
Merge pull request #5 from mcdittmar/master
Integrate gradle toolkit workspace
2 parents 2dc6427 + c2f912e commit 332795d

7 files changed

+643
-440
lines changed

.github/workflows/preview.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ defaults:
1414
env:
1515
doc_name: Transforms
1616

17-
on:
17+
on: # trigger on commit of files in the doc subdirectory
1818
push:
1919
branches:
20-
- master
20+
- master
21+
paths:
22+
- 'doc/**'
2123

2224
jobs:
2325
build:

.gitignore

+15-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,28 @@
22
# Project specific excludes
33
#
44
#
5-
# Binaries
5+
# ivoatex intermediate files
6+
*.aux
7+
*.bbl
8+
*.blg
9+
*.fdb_latexmk
10+
*.fls
11+
*.lof
12+
*.log
13+
*.out
14+
*.pdf
15+
*.toc
16+
ivoatexmeta.tex
617

718
# vo-dml products
819
*.cmap
920
*.svrlt
1021
*.gvd
1122
*.validation-report.txt
1223

24+
# vo-dml toolkit files
25+
.gradle
26+
1327
# OS
1428
.DS_Store
1529

model/trans_1.0_uml2p4p1.xmi

+437-437
Large diffs are not rendered by default.

work/README.md

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
2+
# Overview
3+
4+
This is a workspace area for the development of the data model and subsequent generation
5+
of the various products derived from the vo-dml/XML representation of the model.
6+
7+
Since there are many paths for generating the data model documents, the products themselves
8+
are stored in the other directories of this repository, and no software is installed in this
9+
workspace. Instead, we provide the instructions for duplicating the workflow used to create
10+
the current products.
11+
12+
# Data Modeling Tool
13+
14+
The modeling itself is currently done using Modelio. This includes the UML diagrams, and documentation
15+
of the model elements. This is exported as an XMI (UML-2.4.1 format) document which can be found in the 'model'
16+
sibling directory. The XMI file is processed using the VO-DML Toolkit to generate the VO-DML/XML file and
17+
other products.
18+
19+
# VO-DML Toolkit plugin
20+
21+
This toolkit provides a set of tasks for generating and translating vo-dml/XML files.
22+
For details on the toolkit, please see the "[Using the VO-DML Gradle Plugin](https://github.com/ivoa/vo-dml/tree/master/tools)"
23+
page of the [VO-DML repository](https://github.com/ivoa/vo-dml).
24+
25+
The files included here are those necessary to execute the tasks outlined below.
26+
27+
## Setup
28+
29+
* Clone this repository
30+
The toolkit is a command-line system
31+
32+
* "[VO-DML Tools Guide](https://ivoa.github.io/vo-dml/)"
33+
Guide on the VO-DML Toolkit and how to use it.
34+
35+
* Install gradle
36+
Instructions can be found on the "[Using the VO-DML Gradle Plugin](https://github.com/ivoa/vo-dml/tree/master/tools)" page.
37+
There is no need to run the `gradle init` command, this space includes the files generated by that process tailored to
38+
this particular model and directory structure.
39+
40+
Note: While gradle requires Java 8 or higher, the toolkit itself requires Java 11 in your environment.
41+
42+
* build.gradle.kts
43+
* gradle connection to vo-dml toolkit plugin
44+
* dependencies and required information (directory specs)
45+
* register additional tasks
46+
* settings.gradle.kts
47+
* gradle support
48+
* bindings_<model>_model.xml
49+
* mapping between model and generated files.
50+
51+
52+
## Running Tasks
53+
54+
The toolkit contains several tasks which can be used to generate and validate VO-DML/XML files, or translate them into
55+
various other formats or to code. These instructions are focused on the tasks used to create and validate the
56+
VO-DML/XML files and generation of the standard HTML documentation.
57+
58+
* ```%> gradle UMLToVODML```
59+
This model is currently developed using the Modelio UML tool and exported to UML-2.4.1 format.
60+
This command translates the XMI file into the VO-DML/XML representation.
61+
62+
* input, output, and translation script are specified with the task registration in build.gradle.kts
63+
* the task locates the xmi file, and executes the specified translation script
64+
* output is written to ./src/main/vo-dml/
65+
66+
* ```%> gradle vodmlValidate```
67+
Runs the VO-DML validation utility on the vo-dml/xml file.
68+
69+
* locates the vo-dml/XML file using the information contained in build.gradle.kts
70+
* executes the validation utility
71+
* output is echoed to the screen
72+
73+
* ```%> gradle vodslToVodml --dml=<file spec for vo-dml/xml file> --dsl=<file spec to vodsl file>```
74+
Runs a utility to VO-DML/XML files from models described in vodsl format.
75+
76+
* locates the vodsl file using the information contained in build.gradle.kts
77+
* executes the translation task
78+
* output is written to ./src/main/vodsl/
79+
80+
* ```%> gradle vodmlDoc```
81+
Runs a utility to generate HTML (and Tex) representation of the model.
82+
Note: This model does not use the Tex format output from this utility for the actual PDF document.
83+
84+
* locates the vo-dml/XML file using the information contained in build.gradle.kts
85+
* executes the translation task
86+
* output is written to ./build/generated/docs/vodml
87+
88+
89+
* Schema Generation

work/binding_transform_model.xml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<m:mappedModels xmlns:m="http://www.ivoa.net/xml/vodml-binding/v0.9.1">
3+
<!-- ========================================
4+
-->
5+
<model>
6+
<name>trans</name>
7+
<file>Trans-v1.0.vo-dml.xml</file>
8+
<java-package>org.ivoa.trans.transform</java-package>
9+
<xml-targetnamespace prefix="trans">http://ivoa.net/dm/models/vo-dml/xsd/trans/</xml-targetnamespace>
10+
</model>
11+
</m:mappedModels>

work/build.gradle.kts

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
2+
plugins {
3+
// id("net.ivoa.vo-dml.vodmltools") version "0.4.5" << requires gradle version 8.0+
4+
id("net.ivoa.vo-dml.vodmltools") version "0.3.14"
5+
}
6+
7+
group = "org.javastro.ivoa.dm" // "net.ivoa.vo-dml"
8+
version = "0.4.1-SNAPSHOT" // "0.2-SNAPSHOT"
9+
10+
// Settings for all vodml tools
11+
vodml {
12+
// where to find the vodml XML files (using 'project' structure)
13+
// - defaults to src/main/vo-dml
14+
//vodmlDir.set( file("<path to vo-dml files>") )
15+
16+
// identify the vodml XML files
17+
// - defaults to all "*.vo-dml.xml" files in vodmlDir
18+
//vodmlFiles.setFrom( project.files( vodmlDir.file("Trans-v1.0.vo-dml.xml") ))
19+
20+
// where to find the VODSL files
21+
// - defaults to src/main/vodsl
22+
//vodslDir.set( file("./src/main/vodsl") )
23+
24+
// identify the VODSL files (using 'project' structure)
25+
// - defaults to all "*.vodsl" files in vodslDir
26+
//vodslFiles.setFrom( project.files( vodslDir.file("Trans-v1.0.vodsl") ))
27+
28+
// where to find the binding file(s)
29+
// - finds them by pattern in the project file tree. (eg: binding_proposal_model.xml )
30+
bindingFiles.setFrom( project.files(
31+
layout.projectDirectory.asFileTree.matching( PatternSet().include("binding*model.xml") )
32+
))
33+
34+
// where to put output from vodmlDoc task
35+
outputDocDir.set(layout.projectDirectory.dir("std/generated"))
36+
37+
// where to put output from vodmlSite task ( toolkit 0.4.5 )
38+
// outputSiteDir.set(layout.projectDirectory.dir("docs/generated"))
39+
40+
// which models to process ( for repos containing multiple models? )
41+
modelsToDocument.set("transform")
42+
}
43+
44+
// Register task to execute UML converter which is very custom
45+
tasks.register( "UmlToVodml", net.ivoa.vodml.gradle.plugin.XmiTask::class.java){
46+
// ----------------------------------------------------------
47+
// creates build/tmp/UmlToVodml tree to write temporary files
48+
// ----------------------------------------------------------
49+
description = "convert UML to VO-DML"
50+
51+
// the conversion script to use
52+
xmiScript.set("xmi2vo-dml_Modelio3.7_UML2.4.1.xsl")
53+
54+
// where to find the UML XMI file
55+
xmiFile.set(file("../model/trans_1.0_uml2p4p1.xmi"))
56+
57+
// output VO-DML/XML file to 'project' tree structure
58+
// - this lets us use a lot of default settings in the vodml block
59+
vodmlFile.set(file("./src/main/vo-dml/Trans-v1.0.vo-dml.xml"))
60+
}

work/settings.gradle.kts

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
rootProject.name = "TransformDM"
2+
3+
// space for gradle toolkit to work within
4+
// - this doesn't appear to be necessary
5+
include("work")
6+
7+
8+
pluginManagement {
9+
repositories {
10+
mavenLocal() // IMPL allow picking up from local - should be removed when publishing
11+
gradlePluginPortal()
12+
}
13+
}
14+
15+
dependencyResolutionManagement {
16+
repositories {
17+
mavenLocal()
18+
mavenCentral()
19+
/*
20+
add this repository to pick up the SNAPSHOT version of the IVOA base library - in the future when this
21+
will not be necessary when this library is released as a non-SNAPSHOT version.
22+
*/
23+
maven {
24+
url= uri("https://oss.sonatype.org/content/repositories/snapshots/")
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)