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
69 changes: 40 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,25 @@ plugins {
id 'checkstyle'
id 'codenarc'
id 'maven-publish'
id 'org.asciidoctor.jvm.convert' version '3.3.2' // 4.0.2 does not compile
id 'org.asciidoctor.jvm.pdf' version '3.3.2' // 4.0.2 does not compile
id 'org.owasp.dependencycheck' version '9.2.0' apply false //Not tested after 7.4.4
id 'se.patrikerdes.use-latest-versions' version '0.2.19' apply false
id 'com.github.ben-manes.versions' version '0.53.0' apply false
id "com.github.ManifestClasspath" version "0.1.0-RELEASE"
id "com.github.jakemarsden.git-hooks" version "0.0.2"
id "com.github.node-gradle.node" version '7.1.0' apply false
id "org.asciidoctor.jvm.convert" version "latest.release"
id "org.owasp.dependencycheck" version "latest.release" apply false
id "se.patrikerdes.use-latest-versions" version "latest.release" apply false
id "com.github.ben-manes.versions" version "latest.release" apply false
id "com.github.ManifestClasspath" version "latest.release"
id "com.github.jakemarsden.git-hooks" version "latest.release"
id "com.github.node-gradle.node" version "latest.release" apply false
}

/* OWASP plugin
*
* If project property "enableOwasp" is flagged then
* gradle will download required dependencies and
* activate Gradle's OWASP plugin and its related tasks.
*
* Syntax: gradlew -PenableOwasp dependencyCheckAnalyze
*/
if (project.hasProperty('enableOwasp')) {
apply plugin: 'org.owasp.dependencycheck'
}

/* DependencyUpdates plugin
Expand Down Expand Up @@ -101,8 +112,8 @@ javadoc {
}

java {
sourceCompatibility(JavaVersion.VERSION_17)
targetCompatibility(JavaVersion.VERSION_17)
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

// Java compile options, syntax gradlew -PXlint:none build
Expand Down Expand Up @@ -134,24 +145,24 @@ allprojects {
// on mavenCentral directly
maven {
// org.restlet and org.restlet.ext.servlet
url 'https://maven.restlet.talend.com'
url = 'https://maven.restlet.talend.com'
}
maven {
// net.fortuna.ical4j:ical4j:1.0-rc3-atlassian-11
url 'https://packages.atlassian.com/maven-3rdparty/'
url = 'https://packages.atlassian.com/maven-3rdparty/'
}
maven {
// org/milyn/flute/1.3/flute-1.3.jar
// need artifact only because of wrong pom metadata in maven central
// Required by: plugins:birt > org.eclipse.birt.runtime:viewservlets:4.5.0 > org.eclipse.birt.runtime:org.eclipse.birt.runtime:4.4.1
// TODO Maybe this will no longer needed wheh upgrading viewservlets to 4.9.0
url "https://repo1.maven.org/maven2"
url = "https://repo1.maven.org/maven2"
metadataSources {
artifact()
}
}
maven {
url 'https://clojars.org/repo'
url = 'https://clojars.org/repo'
}
}
}
Expand Down Expand Up @@ -331,12 +342,12 @@ def sysadminGroup = 'System Administration'

task loadAll(group: ofbizServer) {
dependsOn 'generateSecretKeys', 'ofbiz --load-data'
description 'Load default data; meant for OFBiz development, testing, and demo purposes'
description = 'Load default data; meant for OFBiz development, testing, and demo purposes'
}

task testIntegration(group: ofbizServer) {
dependsOn 'ofbiz --test'
description 'Run OFBiz integration tests; You must run loadAll before running this task'
description = 'Run OFBiz integration tests; You must run loadAll before running this task'
}

task terminateOfbiz(group: ofbizServer,
Expand All @@ -360,7 +371,7 @@ task terminateOfbiz(group: ofbizServer,
}

task loadAdminUserLogin(group: ofbizServer) {
description 'Create admin user with temporary password equal to ofbiz. You must provide userLoginId'
description = 'Create admin user with temporary password equal to ofbiz. You must provide userLoginId'
createOfbizCommandTask('executeLoadAdminUser',
['--load-data', 'file=/runtime/tmp/AdminUserLoginData.xml'])
executeLoadAdminUser.doFirst {
Expand Down Expand Up @@ -488,11 +499,11 @@ task createTenant(group: ofbizServer, description: 'Create a new tenant in your

// ========== Documentation tasks ==========
tasks.withType(AsciidoctorTask) { task ->
inProcess = JAVA_EXEC
forkOptions {
executionMode = JAVA_EXEC
jvm {
jvmArgs("--add-opens","java.base/sun.nio.ch=ALL-UNNAMED","--add-opens","java.base/java.io=ALL-UNNAMED")
}
outputOptions {
// outputOptions {
// // I hate we have to do this - but JRuby (asciidoctorj-pdf) and Windows don't mix well
// if (System.properties['os.name'].toLowerCase().contains('windows')) {
// backends = ['html5']
Expand All @@ -504,8 +515,8 @@ tasks.withType(AsciidoctorTask) { task ->
// at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1017)
// at RUBY.require(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:85)
// at RUBY.<main>(<script>:1)
backends = ['html5']
}
// backends = ['html5']
// }
attributes \
'doctype': 'book',
'revnumber': getCurrentGitBranch(),
Expand Down Expand Up @@ -541,18 +552,18 @@ task deleteAllPluginsDocumentation {

task generateReadmeFiles(group: docsGroup, type: AsciidoctorTask) {
doFirst { delete "${buildDir}/asciidoc/readme" }
description 'Generate OFBiz README files'
description = 'Generate OFBiz README files'
sourceDir "${rootDir}"
// CHANGELOG.adoc should be only present in the current stable version
sources {
include 'README.adoc', 'CHANGELOG.adoc', 'CONTRIBUTING.adoc', 'DOCKER.adoc'
}
outputDir file("${buildDir}/asciidoc/readme/")
outputDir = file("${buildDir}/asciidoc/readme/")
}

task generateOfbizDocumentation(group: docsGroup, type: AsciidoctorTask) {
dependsOn deleteOfbizDocumentation
description 'Generate OFBiz documentation manuals'
description = 'Generate OFBiz documentation manuals'
activeComponents().each { component ->
copy {
from "${component}/src/docs/asciidoc/images/${component.name}"
Expand All @@ -561,7 +572,7 @@ task generateOfbizDocumentation(group: docsGroup, type: AsciidoctorTask) {
}
}
sourceDir "${rootDir}/docs/asciidoc"
outputDir file("${buildDir}/asciidoc/ofbiz")
outputDir = file("${buildDir}/asciidoc/ofbiz")
doLast {
activeComponents().each { component ->
delete "${rootDir}/docs/asciidoc/images/${component.name}"
Expand All @@ -571,7 +582,7 @@ task generateOfbizDocumentation(group: docsGroup, type: AsciidoctorTask) {

task generatePluginDocumentation(group: docsGroup) {
dependsOn deletePluginDocumentation
description 'Generate plugin documentation. Expects pluginId flag'
description = 'Generate plugin documentation. Expects pluginId flag'
activeComponents()
.findAll { project.hasProperty('pluginId') && it.name == pluginId }
.each { component ->
Expand Down Expand Up @@ -618,7 +629,7 @@ task generateAllPluginsDocumentation(group: docsGroup,
}
if (asciidocFolder.exists()) {
sourceDir file("${component}/src/docs/asciidoc")
outputDir file("${buildDir}/asciidoc/plugins/${component.name}")
outputDir = file("${buildDir}/asciidoc/plugins/${component.name}")
doLast { println "Documentation generated for plugin ${component.name}" }
}
mustRunAfter deleteAllPluginsDocumentation
Expand Down Expand Up @@ -955,7 +966,7 @@ task cleanFooterFiles(group: cleanupGroup, description: 'clean generated footer
*/
def cleanTasks = tasks.findAll { it.name ==~ /^clean.+/ }
task cleanAll(group: cleanupGroup, dependsOn: [cleanTasks, clean]) {
description 'Execute all cleaning tasks.'
description = 'Execute all cleaning tasks.'
}

/* ========================================================
Expand Down
2 changes: 1 addition & 1 deletion config/codenarc/codenarc.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ ruleset {
// rulesets/size.xml
// TODO : need refactoring AbcMetric // Requires the GMetrics jar
ClassSize
CrapMetric // Requires the GMetrics jar and a Cobertura coverage file
// CrapMetric // Requires the GMetrics jar and a Cobertura coverage file
// TODO : need refactoring CyclomaticComplexity // Requires the GMetrics jar
MethodCount
// TODO : need refactoring MethodSize
Expand Down
Loading