From be535b5d355043136b4577c6a15707e6a93cb554 Mon Sep 17 00:00:00 2001 From: Adrian Kunz Date: Fri, 17 Dec 2021 11:51:16 +0100 Subject: [PATCH 1/4] build: Set up sourcesJar, javadocJar and signing --- build.gradle | 86 ++++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/build.gradle b/build.gradle index c44bde5b..7487ee10 100644 --- a/build.gradle +++ b/build.gradle @@ -19,6 +19,7 @@ plugins { id 'java-library' id 'antlr' id 'maven-publish' + id 'signing' // https://plugins.gradle.org/plugin/com.palantir.revapi id 'com.palantir.revapi' version '1.5.0' // https://plugins.gradle.org/plugin/org.fulib.fulibGradle @@ -44,56 +45,55 @@ repositories { mavenCentral() } -nexusPublishing { - repositories { - sonatype() - } +nexusPublishing.repositories.sonatype() + +java { + withJavadocJar() + withSourcesJar() } -publishing { - publications { - mavenJava(MavenPublication) { - from(components.java) - pom { - name = project.name - description = project.description - url = 'https://github.com/fujaba/fulib' - inceptionYear = '2018' - - scm { - url = 'https://github.com/fujaba/fulib' - } - - licenses { - license { - name = 'MIT License' - url = 'https://www.opensource.org/licenses/mit-license.php' - } - } - - developers { - developer { - id = 'zuendorf' - name = 'Albert Zuendorf' - } - developer { - id = 'digitalhoax' - name = 'Tobias George' - } - developer { - id = 'eicke123' - name = 'Christoph Eickhoff' - } - developer { - id = 'Clashsoft' - name = 'Adrian Kunz' - } - } +publishing.publications.create('mavenJava', MavenPublication) { + it.from(components.java) + it.pom { + name = project.name + description = project.description + url = 'https://github.com/fujaba/fulib' + inceptionYear = '2018' + + scm { + url = 'https://github.com/fujaba/fulib' + } + + licenses { + license { + name = 'MIT License' + url = 'https://www.opensource.org/licenses/mit-license.php' + } + } + + developers { + developer { + id = 'zuendorf' + name = 'Albert Zuendorf' + } + developer { + id = 'digitalhoax' + name = 'Tobias George' + } + developer { + id = 'eicke123' + name = 'Christoph Eickhoff' + } + developer { + id = 'Clashsoft' + name = 'Adrian Kunz' } } } } +signing.sign publishing.publications.mavenJava + dependencies { // https://mvnrepository.com/artifact/org.fulib/fulibScenarios fulibScenarios group: 'org.fulib', name: 'fulibScenarios', version: '1.7.0' From 9969d8d40b6fcb2ed2a081bb40744ab9b9b8a333 Mon Sep 17 00:00:00 2001 From: Adrian Kunz Date: Tue, 28 Dec 2021 13:31:19 +0100 Subject: [PATCH 2/4] fix: Avoid Exception control flow --- .../fulib/util/AbstractGenerator4ClassFile.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/fulib/util/AbstractGenerator4ClassFile.java b/src/main/java/org/fulib/util/AbstractGenerator4ClassFile.java index 31311252..2cfb24fd 100644 --- a/src/main/java/org/fulib/util/AbstractGenerator4ClassFile.java +++ b/src/main/java/org/fulib/util/AbstractGenerator4ClassFile.java @@ -115,16 +115,12 @@ public STGroup getSTGroup(String origFileName) private STGroup loadSTGroup(String origFileName) { - STGroup group; - try + STGroup group = new STGroupFile(origFileName); + if (this.customTemplatesFile != null) { - group = new STGroupFile(this.customTemplatesFile); - STGroup origGroup = new STGroupFile(origFileName); - group.importTemplates(origGroup); - } - catch (Exception e) - { - group = new STGroupFile(origFileName); + final STGroup custom = new STGroupFile(this.customTemplatesFile); + custom.importTemplates(group); + group = custom; } group.registerRenderer(String.class, new FulibStringRenderer()); return group; From 09500ad216f874f6d88f2fb5cd42b3d55971867e Mon Sep 17 00:00:00 2001 From: Adrian Kunz Date: Tue, 28 Dec 2021 13:31:52 +0100 Subject: [PATCH 3/4] build: Update to Gradle Wrapper v7.3.3 --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e750102e..2e6e5897 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 09c934c7b3e04f306d458568592ff059eb66d2f4 Mon Sep 17 00:00:00 2001 From: Adrian Kunz Date: Thu, 3 Aug 2023 11:26:15 +0200 Subject: [PATCH 4/4] docs: Document SDMLib migration --- docs/sdmlib-migration.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/sdmlib-migration.md diff --git a/docs/sdmlib-migration.md b/docs/sdmlib-migration.md new file mode 100644 index 00000000..4e2a41b0 --- /dev/null +++ b/docs/sdmlib-migration.md @@ -0,0 +1,19 @@ +# Migrating from SDMLib + +SDMLib syntax can be migrated to fulib decorator syntax with a few regular expressions: + +> The examples assume a `ClassModelManager model` parameter. + +```regexp +(\w+).(with|create)Attribute\( +model.haveAttribute($1, + +(\w+).(with|create)UniDirectional\((\w+), "(\w+)", (ONE|MANY)\) +model.associate($1, "$3", $4, $2, null, 0) + +(\w+).(with|create)Bidirectional\((\w+), "(\w+)", (ONE|MANY), "(\w+)", (ONE|MANY)\) +model.associate($1, "$3", $4, $2, "$5", $6) + +\)\.withSuperClazz\( +, +```