Skip to content

Commit eeebe62

Browse files
authored
Merge pull request #279 from Open-MBEE/develop
6.1.0
2 parents a45a494 + 566d9f0 commit eeebe62

33 files changed

+1478
-256
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ venv/*
2121
*.groovy
2222
libz
2323
mddocs
24+
bin
25+
.run

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Cameo Model Development Kit (MDK)
22

3-
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/Open-MBEE/mdk?label=download)](https://github.com/Open-MBEE/mdk/releases/latest) [![Maven Central](https://img.shields.io/maven-central/v/org.openmbee.mdk.magic/mdk)](https://search.maven.org/artifact/org.openmbee.mdk.magic/mdk) [![Jira](https://img.shields.io/badge/issues-jira-blue)](https://openmbee.atlassian.net/browse/MDK) [![CircleCI](https://circleci.com/gh/Open-MBEE/mdk.svg?style=shield)](https://circleci.com/gh/Open-MBEE/mdk) [![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/Open-MBEE/mdk.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Open-MBEE/mdk/context:java)
3+
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/Open-MBEE/mdk?label=download)](https://github.com/Open-MBEE/mdk/releases/latest) [![Maven Central](https://img.shields.io/maven-central/v/org.openmbee.mdk.magic/mdk)](https://search.maven.org/artifact/org.openmbee.mdk.magic/mdk) [![CircleCI](https://circleci.com/gh/Open-MBEE/exec-cameo-mdk.svg?style=shield)](https://circleci.com/gh/Open-MBEE/mdk)
44

55
Cameo MDK is a plugin for [Cameo Systems Modeler](https://www.nomagic.com/products/cameo-systems-modeler) and other No Magic environment bundles that’s primary purposes are to sync models with the [MMS](https://github.com/Open-MBEE/mms-alfresco) and implement the [DocGen](src/main/dist/manual) language, which allows modelers to dynamically generate documents in a model-based approach using the view and viewpoint concept.
66

@@ -12,8 +12,9 @@ The latest user documentation can be accessed online: https://mdk.readthedocs.io
1212

1313
## Prerequisites
1414

15-
* [Cameo Systems Modeler (CSM)](https://www.nomagic.com/products/cameo-systems-modeler) or another No Magic environment bundle that includes the [SysML plugin](https://www.nomagic.com/product-addons/magicdraw-addons/sysml-plugin)
16-
* The latest Cameo MDK is compatible with **19.0 SP3** and **19.0 SP4**. Compatibility for previous versions of Cameo MDK can be found in the [compatibility matrices](https://github.com/Open-MBEE/open-mbee.github.io/wiki/Compatibilities).
15+
* [Cameo Systems Modeler (CSM)](https://www.nomagic.com/products/cameo-systems-modeler) or another No Magic environment bundle that includes the [SysML plugin](https://www.nomagic.com/product-addons/magicdraw-addons/sysml-plugin) (Only CSM has been tested)
16+
* The latest Cameo MDK is compatible with **2021x Refresh2** thru **2022x Refresh2**. Compatibility for previous versions of Cameo MDK can be found in the [compatibility matrices](https://github.com/Open-MBEE/open-mbee.github.io/wiki/Compatibilities).
17+
1718
* [Model Management System (MMS)](https://www.openmbee.org/projects.html#mms)
1819
* The Cameo MDK (5.0+) is compatible with MMS **4.x**. Compatibility for previous version of Cameo MDK can be found in the [compatibility matrices](https://github.com/Open-MBEE/open-mbee.github.io/wiki/Compatibilities).
1920

build.gradle

Lines changed: 63 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ buildscript {
1313
}
1414
dependencies {
1515
classpath "io.github.gradle-nexus:publish-plugin:1.0.0"
16+
classpath group: "com.jfrog.artifactory", name: 'com.jfrog.artifactory.gradle.plugin', version: '5.1.9'
1617
classpath group: 'org.openjfx', name: 'javafx-plugin', version: '0.0.14'
1718
}
1819
}
@@ -24,10 +25,12 @@ plugins {
2425
id 'java'
2526
id 'distribution'
2627
id 'org.openjfx.javafxplugin' version '0.0.14'
28+
id 'com.jfrog.artifactory' version '5.1.9'
2729
}
2830

2931
String buildProfile = project.getProperties().getOrDefault('buildProfile', 'opensource')
3032
String buildTag = project.getProperties().get('buildTag')
33+
3134
if (buildTag != null && !buildTag.isEmpty() && buildTag != version) {
3235
throw new GradleException('Version mismatch: ' + buildTag + ' vs ' + version)
3336
}
@@ -64,7 +67,8 @@ else {
6467

6568

6669
String docbookNameVersion = 'docbook-xsl-1.79.1'
67-
String fopNameVersion = 'fop-1.1'
70+
String fopNameVersion = 'fop-2.9'
71+
6872

6973
// In this section you declare where to find the dependencies of your project
7074
repositories {
@@ -167,10 +171,6 @@ dependencies {
167171
implementation group: 'net.sf.opencsv', name: 'opencsv', version: '2.3'
168172
// implementation group: 'com.opencsv', name: 'opencsv', version: '3.8+'
169173

170-
// ActiveMQ
171-
//implementation group: 'org.apache.activemq', name: 'activemq-all', version: '5.9.1'
172-
// implementation group: 'org.apache.activemq', name: 'activemq-all', version: '5.14.0+'
173-
174174
// Jackson
175175
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.3'
176176

@@ -188,9 +188,6 @@ dependencies {
188188
// Apache Commons CLI
189189
implementation group: 'commons-cli', name: 'commons-cli', version: '1.4'
190190

191-
//OpenMBEE MMS Java Client
192-
//implementation group: 'org.openmbee.mms', name: 'mms-java-client', version: '3.4.2'
193-
194191
implementation group: 'com.beust', name: 'jcommander', version: '1.72'
195192

196193
// Test Dependencies
@@ -207,50 +204,44 @@ dependencies {
207204

208205
// Other dependencies we're unable to resolve via standard repositories
209206

207+
// Handle build all-in-one profile workflow
210208
if (profiles['nomagicDeps'] != null) {
211209
def mdDeps = parser.parseText(profiles['nomagicDeps'].toString())
212210
mdDeps.each {
213211
def dep = it
214212
preImplementation group: "${dep.group}", name: "${dep.name}", version: "${dep.version}", classifier: "${dep.classifier != null ? dep.classifier : ''}", ext: "${dep.ext}"
215213
}
216214
}
215+
// Default Dev Workflow, this will only correctly pull from the local ./libz flatDir
217216
else {
218-
preImplementation group: 'com.nomagic', name: 'democsm', version: '2022xRefresh1', classifier: 'Cameo_Systems_Modeler_2022x_Refresh1_HF1_no_install', ext: 'zip'
219-
// preCompile group: 'com.nomagic', name: 'sysml', version: '2021x', classifier: 'SysML_Plugin_2021x', ext: 'zip'
220-
// preCompile group: 'com.nomagic', name: 'cst', version: '2021x', classifier: 'Cameo_Simulation_Toolkit_Plugin_2021x', ext: 'zip'
217+
preImplementation group: 'com.nomagic', name: 'democsm', version: '2022xRefresh2', classifier: 'Cameo_Systems_Modeler_2022x_Refresh2_HF1_no_install', ext: 'zip'
221218
}
222219

223-
preImplementation group: 'org.apache.fop', name: 'fop', version: '1.1', classifier: fopNameVersion + '-bin', ext: 'zip'
220+
preImplementation group: 'org.apache.fop', name: 'fop', version: '2.9', classifier: fopNameVersion + '-bin', ext: 'zip'
224221
preImplementation group: 'net.sourceforge.docbook', name: 'docbook-xsl', version: '1.79.1', classifier: docbookNameVersion, ext: 'zip'
225222

226223
// JavaFX
227-
//preImplementation group: 'org.openjfx', name: 'javafx-fxml', version: '11.0.2'
228-
//preImplementation group: 'org.openjfx', name: 'javafx-controls', version: '11.0.2'
229-
//preImplementation group: 'org.openjfx', name: 'javafx-swing', version: '11.0.2'
224+
distribution group: 'org.openjfx', name: 'javafx-fxml', version: '11.0.2', classifier: 'win'
225+
distribution group: 'org.openjfx', name: 'javafx-controls', version: '11.0.2', classifier: 'win'
226+
distribution group: 'org.openjfx', name: 'javafx-swing', version: '11.0.2', classifier: 'win'
227+
distribution group: 'org.openjfx', name: 'javafx-fxml', version: '11.0.2', classifier: 'mac'
228+
distribution group: 'org.openjfx', name: 'javafx-controls', version: '11.0.2', classifier: 'mac'
229+
distribution group: 'org.openjfx', name: 'javafx-swing', version: '11.0.2', classifier: 'mac'
230+
230231

231232
// This ensures classpath load order to match the MagicDraw provided order and then includes extras needed for non-OpenAPI stuff.
232233
// This was necessary because of the Application class stubbing that was done in the chromium libraries.
233234
implementation files(classpathLibraries.collect { 'build/dependency-cache/extracted/magicdraw/' + it })
234-
implementation fileTree(dir: 'build/dependency-cache/extracted/magicdraw', include: ['lib/**/*.jar', 'plugins/**/*.jar'], exclude: ([classpathLibraries, ['plugins/com.nomagic.collaborator.publisher/**/*.jar', 'plugins/com.nomagic.magicdraw.emfuml2xmi*/**/*.jar', 'plugins/com.nomagic.magicdraw.automaton/lib/engines/**/*.jar', 'plugins/tomsawyer/**/*.jar', 'plugins/com.intercax.syndeia.md/**/*.jar']]).flatten())
235+
implementation fileTree(dir: 'build/dependency-cache/extracted/magicdraw', include: ['lib/**/*.jar', 'plugins/**/*.jar'], exclude: ([classpathLibraries, ['plugins/com.nomagic.conceptmodeler/**/*jar', 'plugins/com.nomagic.magicdraw.xmiexporter/**/*jar', 'plugins/com.nomagic.collaborator.publisher/**/*.jar', 'plugins/com.nomagic.magicdraw.emfuml2xmi*/**/*.jar', 'plugins/com.nomagic.magicdraw.automaton/lib/engines/**/*.jar', 'plugins/tomsawyer/**/*.jar', 'plugins/com.intercax.syndeia.md/**/*.jar']]).flatten())
235236
implementation fileTree(dir: 'lib', include: ['**/*.jar'])
236-
implementation files("build/dependency-cache/extracted/fop/jars/${fopNameVersion}.jar", 'build/dependency-cache/extracted/fop/jars/xmlgraphics-commons-1.5.jar')
237-
if (profiles["implementationFiles"] != null) {
238-
def implementationArray = profiles["implementationFiles"].toString().split(',')
239-
implementationArray.each {
240-
implementation files(it)
241-
}
242-
}
243-
else {
244-
implementation files('build/dependency-cache/extracted/fop/jars/fop-1.1.jar', 'build/dependency-cache/extracted/fop/jars/xmlgraphics-commons-1.5.jar')
245-
}
237+
implementation files("build/dependency-cache/extracted/fop/jars/fop-core-2.9.jar", "build/dependency-cache/extracted/fop/jars/fop-events-2.9.jar", "build/dependency-cache/extracted/fop/jars/fop-util-2.9.jar", 'build/dependency-cache/extracted/fop/jars/xmlgraphics-commons-2.9.jar')
246238

247239
}
248240

249241
javafx {
250242
version = "11.0.2"
251243
modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.swing' ]
252-
platform = 'win'
253-
configurations = ['preImplementation']
244+
platform = 'linux'
254245
}
255246

256247
task extractDependencies {
@@ -267,12 +258,11 @@ task extractDependencies {
267258
into archive.getParentFile().getAbsolutePath()
268259
}
269260
copy {
270-
from archive.getParentFile().getAbsolutePath() + '/' + fopNameVersion + '/build/fop.jar'
261+
from fileTree(dir: archive.getParentFile().getAbsolutePath() + '/' + fopNameVersion + '/fop/build', include: '*.jar')
271262
into 'build/dependency-cache/extracted/fop/jars'
272-
rename { String fileName -> fopNameVersion + '.jar' }
273263
}
274264
copy {
275-
from fileTree(dir: archive.getParentFile().getAbsolutePath() + '/' + fopNameVersion + '/lib', include: '*.jar', exclude: 'commons*.jar')
265+
from fileTree(dir: archive.getParentFile().getAbsolutePath() + '/' + fopNameVersion + '/fop/lib', include: '*.jar', exclude: 'commons*.jar')
276266
into 'build/dependency-cache/extracted/fop/jars'
277267
}
278268
copy { //license3rdparty
@@ -281,7 +271,7 @@ task extractDependencies {
281271
rename { String fileName -> 'apache_fop_license.txt' }
282272
}
283273
copy { //license3rdparty
284-
from fileTree(dir: archive.getParentFile().getAbsolutePath() + '/' + fopNameVersion + '/lib', include: '*.LICENSE.txt', exclude: 'commons*LICENSE.txt')
274+
from fileTree(dir: archive.getParentFile().getAbsolutePath() + '/' + fopNameVersion + '/fop/lib', include: '*.LICENSE.txt', exclude: 'commons*LICENSE.txt')
285275
into 'build/dependency-cache/extracted/fop/license'
286276
rename { String fileName -> fileName.replace(".LICENSE.txt", "_license.txt") }
287277
}
@@ -292,25 +282,26 @@ task extractDependencies {
292282
into 'build/dependency-cache/extracted/docbook'
293283
}
294284
}
295-
else if (archive.getName().startsWith('javafx')) {
296-
copy {
297-
from archive.getAbsoluteFile()
298-
into 'build/dependency-cache/extracted/javafx'
299-
}
300-
}
301285
else {
302286
copy {
303287
from zipTree(archive)
304288
into 'build/dependency-cache/extracted/magicdraw'
305289
}
290+
copy {
291+
from 'build/dependency-cache/extracted/magicdraw/plugins/com.nomagic.conceptmodeler'
292+
into 'build/tmp/com.nomagic.conceptmodeler'
293+
}
294+
306295
}
307296
}
308297
fileTree(dir: 'build/dependency-cache/extracted/magicdraw', include: '*.zip').each { archive ->
309298
copy {
310299
from zipTree(archive)
311300
into 'build/dependency-cache/extracted/magicdraw'
312301
}
302+
313303
}
304+
delete 'build/dependency-cache/extracted/magicdraw/plugins/com.nomagic.conceptmodeler'
314305
}
315306
}
316307
compileJava.dependsOn extractDependencies
@@ -339,7 +330,6 @@ task testsJar(type: Jar, dependsOn: testClasses) {
339330
exclude 'org/openmbee/mdk/test/framework/**'
340331
exclude 'org/**'
341332
exclude 'worker/**'
342-
//include 'gov/nasa/jpl/mbee/mdk/test/tests/**'
343333
}
344334

345335
task testsHackJar(type: Jar, dependsOn: testClasses) {
@@ -349,7 +339,6 @@ task testsHackJar(type: Jar, dependsOn: testClasses) {
349339
include 'org/openmbee/mdk/test/framework/**'
350340
include 'org/**'
351341
include 'worker/**'
352-
//exclude 'gov/nasa/jpl/mbee/mdk/test/tests/**'
353342

354343
manifest {
355344
attributes(
@@ -398,14 +387,11 @@ abstract class PreDist extends DefaultTask {
398387
}
399388
project.copy {
400389
from project.configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts.file
390+
from project.configurations.distribution.resolvedConfiguration.resolvedArtifacts.file
401391
from 'lib'
402392
from project.jar
403393
into "${outputDir}/plugins/${groupName}"
404394
}
405-
project.copy {
406-
from "${extractedCache}/javafx"
407-
into "${outputDir}/plugins/${groupName}/javafx"
408-
}
409395
project.copy {
410396
from project.getTasks().getByName('javadocZip')
411397
into "${outputDir}/plugins/${groupName}/javadoc"
@@ -590,6 +576,27 @@ nexusPublishing {
590576
}
591577
}
592578

579+
artifactoryPublish {
580+
publications('mavenJava')
581+
582+
}
583+
584+
artifactoryPublish.dependsOn distZip
585+
586+
artifactory {
587+
publish {
588+
contextUrl = project.property('artifactoryUrl') as String
589+
repository {
590+
repoKey = project.property('artifactoryRepository')
591+
username = project.getProperties().get('artifactoryUsername').toString()
592+
password = project.getProperties().get('artifactoryPassword').toString()
593+
}
594+
}
595+
if (buildNumber != null && !buildNumber.isEmpty()) {
596+
clientConfig.info.setBuildNumber(buildNumber)
597+
}
598+
}
599+
593600
installDist {
594601
destinationDir = file('build/plugin')
595602
doLast {
@@ -599,6 +606,11 @@ installDist {
599606
from 'build/plugin'
600607
into 'build/install'
601608
}
609+
copy {
610+
from 'build/tmp/com.nomagic.conceptmodeler'
611+
into 'build/install/plugins/com.nomagic.conceptmodeler'
612+
}
613+
delete 'build/tmp/com.nomagic.conceptmodeler'
602614
}
603615
}
604616

@@ -616,8 +628,14 @@ task runJava(type: JavaExec) {
616628
if (profiles["executablePath"] != null) {
617629
executable = profiles["executablePath"]
618630
}
631+
debugOptions {
632+
enabled = true
633+
port = 31001
634+
server = true
635+
suspend = false
636+
}
619637
main = 'com.nomagic.magicdraw.Main'
620-
jvmArgs = ['--module-path', 'plugins/org.openmbee.mdk/javafx', '--add-modules', 'javafx.controls,javafx.swing,javafx.fxml', '-Xmx8192M', '-Xss512M', '-DLOCALCONFIG=true', '-DWINCONFIG=true', '-Djsse.enableSNIExtension=true', '-Djava.net.preferIPv4Stack=true', '-Dcom.sun.media.imageio.disableCodecLib=true', '-noverify', '-Dlocal.config.dir.ext=-dev', '-splash:data/splash.png', '-Dmd.class.path=$java.class.path', '-Desi.system.config=data/application.conf', '-Dlogback.configurationFile=data/logback.xml', '-Dsun.locale.formatasdefault=true', '-Djdk.attach.allowAttachSelf=true']
638+
jvmArgs = ['-Xmx8192M', '-Xss512M', '-DLOCALCONFIG=true', '-DWINCONFIG=true', '-Djsse.enableSNIExtension=true', '-Djava.net.preferIPv4Stack=true', '-Dcom.sun.media.imageio.disableCodecLib=true', '-noverify', '-Dlocal.config.dir.ext=-dev', '-splash:data/splash.png', '-Dmd.class.path=$java.class.path', '-Desi.system.config=data/application.conf', '-Dlogback.configurationFile=data/logback.xml', '-Dsun.locale.formatasdefault=true']
621639
// arguments to pass to the application
622640
args 'DEVELOPER'
623641
}

0 commit comments

Comments
 (0)