Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ jobs:
- name: Gradle Info
run: |
./gradlew -v
./gradlew jvmArgs sysProps
# ./gradlew jvmArgs sysProps

- name: Compile with Gradle
run: ./gradlew compile
run: ./gradlew assemble

- name: License header check
run: ./gradlew license
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
!grails-wrapper.jar

# Cache of project
.gradletasknamecache
Expand Down
6 changes: 3 additions & 3 deletions .sdkmanrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=17.0.6-tem
gradle=8.2
groovy=3.0.17
java=21.0.5-tem
gradle=8.4
groovy=4.0.24
82 changes: 39 additions & 43 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,20 @@ buildscript {
mavenCentral()

}
dependencies {
classpath "org.maurodata:mdm-gradle-plugin:$mdmGradlePluginVersion"
}

}

plugins {
id 'groovy'
id 'java-library'
id 'java'
id 'antlr'
id 'maven-publish'
id "com.vanniktech.maven.publish" version "0.29.0"
id "com.github.hierynomus.license" version "0.16.1"
id 'codenarc'
id 'idea'
}

apply plugin: 'uk.ac.ox.softeng.maurodatamapper.gradle.mdm-gradle'


repositories {
mavenLocal()
maven {url "https://plugins.gradle.org/m2/"}
Expand All @@ -54,7 +51,9 @@ sourceSets {
}

license {
exclude("${project.buildDir}/**")
excludes(["${project.buildTreePath}/**",
"**/*.xml"])
header(project.file('NOTICE'))
}

// Setup the generation sourceset configurations to extend from the existing configurations
Expand All @@ -77,7 +76,7 @@ license {
excludes([
'**/dita-ot-*/*',
'**/*.g4',
'**/uk/ac/ox/softeng/ebnf/parser/*',
'**/org/maurodata/dita/ebnf/parser/*',
'**/*.properties'
])
}
Expand Down Expand Up @@ -106,11 +105,14 @@ tasks.register('generateDitaSource', JavaExec) {
outputs.dir destDir

classpath = sourceSets.generation.runtimeClasspath
mainClass = 'uk.ac.ox.softeng.maurodatamapper.dita.generation.DocumentationParser'
mainClass = 'org.maurodata.dita.generation.DocumentationParser'
// arguments to pass to the application
argsString = 'build/generated-src/main/dita'
}

java {
withSourcesJar()
}
// Ensure tasks are run in the correct order
// antlr grammar -> generation source set compiled -> dita source generated -> main code compiled
tasks.generateGrammarSource.finalizedBy 'replaceTabsWithSpaces'
Expand All @@ -121,16 +123,11 @@ tasks.sourcesJar.dependsOn 'generateDitaSource'
tasks.licenseGeneration.dependsOn "generateGrammarSource", "generateGenerationGrammarSource", "generateDitaSource"
tasks.licenseTest.dependsOn "generateGrammarSource", "generateGenerationGrammarSource", "generateDitaSource", "generateTestGrammarSource"
tasks.licenseMain.dependsOn "generateDitaSource"
tasks.cpdCheck.dependsOn "generateGrammarSource", "generateGenerationGrammarSource", "generateDitaSource", "generateTestGrammarSource"


checkstyleGeneration{
// Dont bother scanning the generated antlr code
exclude '**/ebnf/parser/**'
}

codenarc {
configFile = rootProject.file("config/codenarc/codenarc.groovy")
ignoreFailures = true

}

Expand All @@ -139,42 +136,19 @@ codenarcGeneration {
// Dont bother scanning the generated code, we've cleaned up most of the issues, the ones remaining are impossible to fix due to the source they're generated from
exclude '**/dita/elements/langref/**'
exclude '**/parser/**'
ignoreFailures = true
}

codenarcMain {
compilationClasspath = sourceSets.main.compileClasspath + sourceSets.main.output
// Dont bother scanning the generated code, we've cleaned up most of the issues, the ones remaining are impossible to fix due to the source they're generated from
exclude '**/dita/elements/langref/**'
exclude '**/parser/**'
}

tasks.cpdCheck {
exclude '**/EbnfLexer.java'
exclude '**/EbnfParser.java'
ignoreFailures true
ignoreFailures = true
}



tasks.spotbugsGeneration{
onlyAnalyze.add('uk.ac.ox.softeng.maurodatamapper.dita.*')
}

tasks.spotbugsMain{
[
'uk.ac.ox.softeng.maurodatamapper.dita.attributes.*',
'uk.ac.ox.softeng.maurodatamapper.dita.enums.*',
'uk.ac.ox.softeng.maurodatamapper.dita.html.*',
'uk.ac.ox.softeng.maurodatamapper.dita.meta.*',
'uk.ac.ox.softeng.maurodatamapper.dita.processor.*',
'uk.ac.ox.softeng.maurodatamapper.dita.DitaProject',
'uk.ac.ox.softeng.maurodatamapper.dita.DitaProjectOptions',
'uk.ac.ox.softeng.maurodatamapper.dita.Test',
].each {
onlyAnalyze.add(it)
}
}

afterEvaluate {
// Make sure intellij shows the build folder so we can see the generated code
// And add the src/main/antlr directory (source dir for antlr plugin) to the source listing so it looks right
Expand All @@ -191,8 +165,8 @@ afterEvaluate {
// Make sure groovy tasks can compile
tasks.withType(GroovyCompile).configureEach {
configure(groovyOptions.forkOptions) {
memoryMaximumSize = '1g'
jvmArgs = ['-Xms512m', '-Xmx1g']
memoryMaximumSize = '4g'
jvmArgs = ['-Xms512m', '-Xmx4g']
}
}
}
Expand All @@ -210,6 +184,28 @@ publishing {
}
}

publishing {
repositories {
maven {
name = "MauroSnapshotRepository"
url = "https://mauro-repository.com/libs-snapshot-local"
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}

publications {
mavenJava(MavenPublication) {
groupId = 'org.maurodata'
artifactId = 'mauro-api'
version = "0.0.1-SNAPSHOT"
from components.java
}
}
}

mavenPublishing {
configure(new JavaLibrary(new JavadocJar.None(), true))
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
Expand Down
14 changes: 0 additions & 14 deletions config/codenarc/codenarc.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -246,20 +246,6 @@ ruleset {
RequiredString
StatelessClass

// rulesets/grails.xml
GrailsDomainGormMethods
GrailsDomainHasEquals
GrailsDomainHasToString
GrailsDomainReservedSqlKeywordName
GrailsDomainStringPropertyMaxSize
GrailsDomainWithServiceReference
GrailsDuplicateConstraint
GrailsDuplicateMapping
GrailsMassAssignment
GrailsPublicControllerMethod
GrailsServletContextReference
GrailsStatelessService

// rulesets/groovyism.xml
AssignCollectionSort
AssignCollectionUnique
Expand Down
9 changes: 4 additions & 5 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
dependencies {

api platform(group: 'uk.ac.ox.softeng.maurodatamapper', name: 'mdm-bom', version: fallbackMdmCoreVersion)

antlr group: 'org.antlr', name: 'antlr4', version: antlr4Version

api group: 'org.codehaus.groovy', name: 'groovy-all', version: groovyVersion
implementation 'org.apache.groovy:groovy-all:4.0.28'
implementation("org.apache.groovy:groovy-xml:4.0.28")
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.14'
runtimeOnly group: 'ch.qos.logback', name: 'logback-classic'
runtimeOnly group: 'ch.qos.logback', name: 'logback-classic', version: '1.5.18'


api group: 'org.apache.commons', name: 'commons-lang3', version: '3.15.0'
Expand Down Expand Up @@ -102,7 +101,7 @@ dependencies {
// For the generation code
generationImplementation group: 'org.ccil.cowan.tagsoup', name: 'tagsoup', version: '1.2.1'

testImplementation group: 'org.spockframework', name: 'spock-core', version: '2.3-groovy-3.0'
testImplementation group: 'org.spockframework', name: 'spock-core', version: '2.3-groovy-4.0'
testImplementation group: 'org.xmlunit', name: 'xmlunit-core', version: '2.10.0'
testImplementation group: 'org.xmlunit', name: 'xmlunit-matchers', version: '2.10.0'
}
22 changes: 4 additions & 18 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
# Core Info
version=1.0.0-SNAPSHOT
version=2.0.0-SNAPSHOT
group=org.maurodata
# Gradle
gradleVersion=8.2
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx2g
org.gradle.parallel=true
org.gradle.caching=true
# Code
sourceCompatibility=17
targetCompatibility=17
# Deployment & Build
mdmCoreVersion=5.4.0-SNAPSHOT
fallbackMdmCoreVersion=5.3.0
mdmGradlePluginVersion=8.0.1
licenseGradlePluginVersion=0.16.1
# Mauro Data Mapper
groovyVersion=3.0.17
oxbrcinformaticsGradlePluginsVersion=8.0
# Addtl
batikVersion=1.14
antlr4Version=4.10.1
antlr4Version=4.10.1

org.gradle.jvmargs=-Xmx4g
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
17 changes: 9 additions & 8 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package uk.ac.ox.softeng.maurodatamapper.dita.generation
package org.maurodata.dita.generation

class DitaAttributeSpecification {
String ditaName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package uk.ac.ox.softeng.maurodatamapper.dita.generation
package org.maurodata.dita.generation

import groovy.util.logging.Slf4j
import org.apache.commons.lang3.StringUtils
Expand Down Expand Up @@ -69,7 +69,7 @@ class DitaElementSpecification {
StringBuilder constructElementFile() {
StringBuilder stringBuilder = new StringBuilder()
.append(licenseHeaderText).append('\n')
.append('package uk.ac.ox.softeng.maurodatamapper.dita.elements.')
.append('package org.maurodata.dita.elements.')
.append(packagePath.join('.'))
.append('\n\n')
.append(constructImports())
Expand Down Expand Up @@ -97,16 +97,16 @@ class DitaElementSpecification {
String constructImports() {
StringBuilder stringBuilder = new StringBuilder()
attributeGroups.each {attributeGroupName ->
stringBuilder.append("import uk.ac.ox.softeng.maurodatamapper.dita.attributes.${attributeGroupName}AttributeGroup\n")
stringBuilder.append("import org.maurodata.dita.attributes.${attributeGroupName}AttributeGroup\n")
}
stringBuilder.append('import uk.ac.ox.softeng.maurodatamapper.dita.meta.DitaElement\n')
stringBuilder.append('import org.maurodata.dita.meta.DitaElement\n')
if (allowsText) {
stringBuilder.append('import uk.ac.ox.softeng.maurodatamapper.dita.meta.TextElement\n')
stringBuilder.append('import org.maurodata.dita.meta.TextElement\n')
}

containedElements.each {elementContainment ->
if (elementContainment.packagePath != this.packagePath) {
stringBuilder.append('import uk.ac.ox.softeng.maurodatamapper.dita.elements.')
stringBuilder.append('import org.maurodata.dita.elements.')
elementContainment.packagePath.each {
stringBuilder
.append(it.toLowerCase())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package uk.ac.ox.softeng.maurodatamapper.dita.generation
package org.maurodata.dita.generation

import groovy.util.logging.Slf4j

Expand All @@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit
class DocumentationParser {

static final String MDM_LICENSE_GIST = 'https://gist.githubusercontent.com/jamesrwelch/680f9016e882a7a4317844580fd6a1fa/raw/2d94405979886d7ef40f08ad29f820704d3e2ad9/NOTICE.tmpl'
static final String BASE_PACKAGE_DIR = 'uk/ac/ox/softeng/maurodatamapper/dita'
static final String BASE_PACKAGE_DIR = 'org/maurodata/dita'
static final String BASE_URL = 'https://docs.oasis-open.org/dita/dita/v1.3/errata02/os/complete/part3-all-inclusive/contentmodels/'

static final Map<String, String> ATTRIBUTE_GROUP_MAP = [
Expand Down
Loading