Skip to content

Commit

Permalink
#68 vmf-edit is part of 0.2.9.4 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
miho committed Nov 27, 2024
1 parent e6050b2 commit d45a121
Show file tree
Hide file tree
Showing 7 changed files with 260 additions and 16 deletions.
2 changes: 1 addition & 1 deletion config/common.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# version number (is used for core, runtime and default dependencies in plugin and plugin)
# publication.version = 0.3-SNAPSHOT
publication.version=0.2.9.5-SNAPSHOT
publication.version=0.2.9.4
#publication.version=0.2.9.3
#publication.version=0.2.8.8
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ include ':core', ':runtime', ':gradle-plugin'

project(':core').name = 'vmf'
project(':runtime').name = 'vmf-runtime'

55 changes: 50 additions & 5 deletions vmfedit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
import java.text.SimpleDateFormat


plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.1.0'
id 'org.beryx.jlink' version '2.25.0'
id 'com.github.node-gradle.node' version '3.3.0'

id 'com.github.hierynomus.license' version '0.16.1'
id 'maven-publish'
id 'net.nemerosa.versioning' version '3.0.0'
id 'com.github.ben-manes.versions' version '0.44.0'
}

group 'eu.mihosoft.vmf'
version '1.0.0-SNAPSHOT'

ext.commonProps = new Properties()
file(new File(projectDir.parentFile,"config/common.properties")).withInputStream { commonProps.load(it) }

apply plugin: 'java-library'
apply from: 'gradle/publishing.gradle'

version = "${project.commonProps.get('publication.version')}"

// installer version (used for jlink/jpackge)
// parse version with three '.' separated numbers from full version string
Expand All @@ -27,8 +41,8 @@ ext {
junitVersion = '5.8.2'
}

sourceCompatibility = '23'
targetCompatibility = '23'
sourceCompatibility = '17'
targetCompatibility = '17'

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
Expand Down Expand Up @@ -120,4 +134,35 @@ copyFontAwesomeToResources.dependsOn installFontAwesome
processResources.dependsOn copyFontAwesomeToResources

copyBootStrapToResources.dependsOn installBootStrap
processResources.dependsOn copyBootStrapToResources
processResources.dependsOn copyBootStrapToResources

jar {
manifest {
attributes('Automatic-Module-Name': 'eu.mihosoft.vmf.vmfedit')
}

// // add velocity legacy to jar file
// from {
// configurations.legacyVelocity.collect { it.isDirectory() ? it : zipTree(it) }
// }
}

license {
header = rootProject.file('core/config/HEADER')
strictCheck = true
ignoreFailures = true
mapping {
java = 'SLASHSTAR_STYLE'
groovy = 'SLASHSTAR_STYLE'
fxml = 'XML_STYLE'
}

ext.yearCurrent = new SimpleDateFormat("yyyy").format(new Date())
ext.yearSince1 = '2017'
ext.author1 = 'Michael Hoffer <[email protected]>'
ext.yearSince2 = '2017'
ext.author2 = 'Goethe Center for Scientific Computing, University Frankfurt'

exclude '**/*.svg'
}

23 changes: 23 additions & 0 deletions vmfedit/gradle/project-info.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// -----------------------------------------------------------------------------
// publishing information
// -----------------------------------------------------------------------------
ext.publishingInfo.artifactId = project.name.toLowerCase()
ext.publishingInfo.groupId = 'eu.mihosoft.vmf'
ext.publishingInfo.versionId = ext.commonProps.get("publication.version")

ext.publishingInfo.developerName = 'Michael Hoffer'
ext.publishingInfo.developerAlias = 'miho'
ext.publishingInfo.developerEmail = '[email protected]'
ext.publishingInfo.inceptionYear = '2017'

ext.publishingInfo.desc = 'VMF JSon Schema Editor Support (VRL Modeling Framework) adds editor support via json schema.'
ext.publishingInfo.license = 'Apache-2.0'
ext.publishingInfo.licenseUrl = 'https://github.com/miho/VMF/blob/master/LICENSE'
ext.publishingInfo.labels = ['vmf', 'modeling', 'data model', 'vrl', 'modeling framework']
ext.publishingInfo.websiteUrl = 'https://github.com/miho/VMF'
ext.publishingInfo.issueTrackerUrl = 'https://github.com/miho/VMF/issues'
ext.publishingInfo.vcsUrl = 'https://github.com/miho/VMF.git'

ext.publishingInfo.gitHubMavenRepo = "https://maven.pkg.github.com/miho/vmf"

ext.publishingInfo.pomName = ext.publishingInfo.artifactId
173 changes: 173 additions & 0 deletions vmfedit/gradle/publishing.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
// -----------------------------------------------------------------------------
// Collect publishing information
// -----------------------------------------------------------------------------
ext.publishingInfo = [:]

ext.publishingInfo.pomName = ext.publishingInfo.artifactId

apply from: "gradle/project-info.gradle"
apply plugin: 'signing'

// -----------------------------------------------------------------------------
// Performs publishing
// -----------------------------------------------------------------------------

task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}

// create one jar for the source files
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}

Date buildTimeAndDate = new Date()
ext {
buildDate = new java.text.SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
buildTime = new java.text.SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
}

jar {
manifest {
attributes(
'Built-By': System.properties['user.name'],
'Created-By': System.properties['java.version'] + " (" + System.properties['java.vendor'] + " " + System.properties['java.vm.version'] + ")",
'Build-Date': project.buildDate,
'Build-Time': project.buildTime,
'Build-Revision': versioning.info.commit,
'Specification-Title': project.name,
'Specification-Version': project.version,
'Implementation-Title': project.name,
'Implementation-Version': project.version
)
}
}


def pomConfig = {
name ext.publishingInfo.pomName
description ext.publishingInfo.desc
url ext.publishingInfo.websiteUrl
inceptionYear ext.publishingInfo.inceptionYear
licenses {
license([:]) {
name ext.publishingInfo.license
url ext.publishingInfo.licenseUrl
distribution 'repo'
}
}
scm {
url ext.publishingInfo.vcsUrl
connection ext.publishingInfo.vcsUrl
developerConnection ext.publishingInfo.vcsUrl
}
developers {
developer {
id ext.publishingInfo.developerNameAlias
name ext.publishingInfo.developerName
}
}
}



publishing {

repositories {
// --------------------------------------------------------------------------------
// Destination Repository 'GitHubPackages'
// -> call task 'publishMavenJavaPublicationToGitHubPackagesRepository' to publish
// --------------------------------------------------------------------------------
maven {
name = "GitHubPackages"
// see https://levelup.gitconnected.com/publish-a-maven-package-to-github-with-gradle-fabc6de24d6
// Replace OWNER and REPOSITORY with your GitHub username/repository
// (must be both lowercase according to the documenations)
// url = uri("https://maven.pkg.github.com/OWNER/REPOSITORY")
url = uri(project.findProperty('publishingInfo').gitHubMavenRepo)
credentials {
// Make sure to generate a token with write-packages and read-packages permission:
// https://github.com/settings/tokens/new
// You can either store the username and token in
// ~/.gradle/gradle.properties (use the gpr.user and gpr.key keys)
// Or you can store them as environment variables e.g. in ~/.bash_profile or ~/.zsh
// depending on your shell (GITHUB_USERNAME and GITHUB_TOKEN keys)
// Or you pass them via CLI: gradle publish -Pgpr.user=username -Pgpr.key=token
// See at EOF for examples on how to store the credentials
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}

// --------------------------------------------------------------------------------
// Destination Repository 'OSSRH'
// telling gradle to publish artifact to local directory
// -> call task 'publishMavenJavaPublicationToOSSRHRepository' to publish
// -> go to https://oss.sonatype.org/#stagingRepositories, click 'close', drink coffee and then click 'release'
// if closing was successful
// --------------------------------------------------------------------------------
maven {
name = "OSSRH"
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username = project.findProperty("oss.user") ?: System.getenv("OSS_USERNAME")
password = project.findProperty("oss.pwd") ?: System.getenv("OSS_PWD")
}
}

// --------------------------------------------------------------------------------
// Destination Repository 'BuildDir'
// telling gradle to publish artifact to local directory
// -> call task 'publishMavenJavaPublicationToBuildDirRepository' to publish
// --------------------------------------------------------------------------------
maven {
name = "BuildDir"
url "file:/${buildDir}/artifacts"
}
}


publications {
mavenJava(MavenPublication) {
groupId publishingInfo.groupId
artifactId publishingInfo.artifactId
version publishingInfo.versionId
from components.java
artifact sourcesJar
artifact javadocJar

pom.withXml {
def root = asNode()
root.appendNode 'description', publishingInfo.desc
root.children().last() + pomConfig
}
}
}
}


if(
project.findProperty("signing.secretKeyRingFile")
&& project.findProperty("signing.password")
&& project.findProperty("signing.keyId")
) {

signing {
sign publishing.publications
}

} else {
println "> skipping signing, provide\n" +
" - 'signing.secretKeyRingFile'\n" +
" - 'signing.password'\n" +
" - 'signing.keyId'\n" +
" to activate it\n"
}
2 changes: 1 addition & 1 deletion vmfedit/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = "vmfedit"
rootProject.name = "vmf-edit"
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ public class JsonEditorController {
private final WebView webView;

/** Property holding the current JSON schema */
private final StringProperty schemaProperty = new SimpleStringProperty("""
{
"$schema" : "http://json-schema.org/draft-07/schema#",
"title" : "value",
"type" : "string",
"readOnly": true,
"default": "set a schema"
}
""");
private final StringProperty schemaProperty = new SimpleStringProperty(
"{\n" +
" \"$schema\" : \"http://json-schema.org/draft-07/schema#\",\n" +
" \"title\" : \"value\",\n" +
" \"type\" : \"string\",\n" +
" \"readOnly\": true,\n" +
" \"default\": \"set a schema\"\n" +
"}");

/** Property holding the current JSON value */
private final StringProperty valueProperty = new SimpleStringProperty("");
Expand Down Expand Up @@ -341,6 +340,9 @@ private String escapeJavaScript(String str) {
.replace("\t", "\\t");
}

/**
* Default error handler for the editor.
*/
private BiConsumer<String, String> onErrorConsumer = (title, message) -> {
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Error");
Expand Down

0 comments on commit d45a121

Please sign in to comment.