Skip to content

Commit

Permalink
Added Java module support
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Feb 24, 2024
1 parent 1ac523f commit 8273f5b
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 17 deletions.
37 changes: 26 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
buildscript {
repositories {
mavenCentral()
}
}

plugins {
id 'java'
id 'java-library'
Expand All @@ -12,17 +6,17 @@ plugins {
id 'jacoco'
id 'signing'
id "pl.allegro.tech.build.axion-release" version "1.13.6"
id "nebula.optional-base" version "7.0.0"
id "biz.aQute.bnd.builder" version "$bndVersion"
id 'org.javamodularity.moduleplugin' version '1.8.14'
}

group = 'org.ical4j'
description = '''
A collection of templates for popular calendar use-cases
'''

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 11
targetCompatibility = 11

repositories {
mavenCentral()
Expand Down Expand Up @@ -59,13 +53,34 @@ dependencies {
}

test {
moduleOptions {
runOnClasspath = true
}

useJUnitPlatform()

finalizedBy jacocoTestCoverageVerification, jacocoTestReport // Ensure Jacoco is run after tests have completed

jvmArgs = [ "-Duser.timezone=UTC" ] // Some tests require default timezone to be UTC
}

jacocoTestCoverageVerification {
dependsOn test
violationRules {
rule {
limit {
minimum = 0.7
}
failOnViolation = false
}
}
}

jacocoTestReport {
dependsOn test
reports {
xml.enabled true
html.enabled false
xml.required = true
html.required = jacoco_htmlReport == 'true'
}
}

Expand Down
14 changes: 8 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
ical4jVersion = 4.0.0-rc3
ical4jVcardVersion = 2.0.0-beta1
ical4jExtensionsVersion = 2.0.0-rc2
ical4jVersion = 4.0.0-rc4
ical4jVcardVersion = 2.0.0-beta3
ical4jExtensionsVersion = 2.0.0-rc4

groovyVersion=3.0.12
groovyVersion=3.0.20
bndVersion = 6.1.0
slf4jVersion = 2.0.7
log4jVersion = 2.20.0
slf4jVersion = 2.0.9
log4jVersion = 2.22.1
j2htmlVersion = 1.5.0

spockVersion = 2.4-M1-groovy-3.0

jacoco_htmlReport = true
13 changes: 13 additions & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module ical4j.template {
requires java.base;
requires ical4j.core;
requires ical4j.vcard;
requires ical4j.extensions;

exports org.ical4j.template;
exports org.ical4j.template.agile;
exports org.ical4j.template.groupware;
exports org.ical4j.template.project;
exports org.ical4j.template.wiki;
exports org.ical4j.template.workflow;
}

0 comments on commit 8273f5b

Please sign in to comment.