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 c8f27e1 commit 02efa40
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 32 deletions.
36 changes: 18 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.palantir.gradle.revapi:gradle-revapi:1.5.0'
}
}

plugins {
id 'signing'
id 'pl.allegro.tech.build.axion-release' version '1.13.6'
id 'biz.aQute.bnd.builder' version "$bndVersion" apply false
id 'org.javamodularity.moduleplugin' version '1.8.10' apply false
id 'org.javamodularity.moduleplugin' version '1.8.13' apply false
}

scmVersion {
Expand All @@ -30,11 +21,15 @@ scmVersion {
}

configure(subprojects) {
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'groovy'
apply plugin: 'biz.aQute.bnd.builder'
// apply plugin: 'org.javamodularity.moduleplugin'
apply plugin: 'org.javamodularity.moduleplugin'

sourceCompatibility = 11
targetCompatibility = 11

repositories {
mavenCentral()
Expand All @@ -44,9 +39,6 @@ configure(subprojects) {
}
}

sourceCompatibility = 8
targetCompatibility = 8

group = 'org.ical4j'
description = '''\
A Java library for accessing iCalendar data stores
Expand All @@ -63,10 +55,8 @@ A Java library for accessing iCalendar data stores
}

dependencies {
api "org.mnode.ical4j:ical4j:$ical4jVersion",
"org.mnode.ical4j:ical4j-vcard:$ical4jVCardVersion"

compileOnly 'org.osgi:osgi.core:8.0.0',
annotationProcessor 'org.osgi:osgi.core:8.0.0',
'org.osgi:org.osgi.service.component.annotations:1.5.0',
'org.osgi:org.osgi.service.metatype.annotations:1.4.1',
'org.osgi:org.osgi.annotation:6.0.0'
Expand All @@ -77,7 +67,7 @@ A Java library for accessing iCalendar data stores
"org.spockframework:spock-core"

// junit
testImplementation "org.junit.vintage:junit-vintage-engine:$junitVintageVersion"
// testImplementation "org.junit.vintage:junit-vintage-engine:$junitVintageVersion"

// testcontainers
testImplementation "org.testcontainers:testcontainers:$testcontainersVersion",
Expand All @@ -97,7 +87,17 @@ A Java library for accessing iCalendar data stores
}
}

compileTestJava {
moduleOptions {
compileOnClasspath = true
}
}

test {
moduleOptions {
runOnClasspath = true
}

useJUnitPlatform()
}

Expand Down
15 changes: 8 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
ical4jVersion = 4.0.0-rc3
ical4jVCardVersion = 2.0.0-beta2
ical4jVersion = 4.0.0-rc4
ical4jVCardVersion = 2.0.0-beta3

jackrabbitWebdavVersion = 2.21.21
jackrabbitCoreVersion = 2.21.21
httpclientVersion = 4.5.14
jackrabbitWebdavVersion = 2.21.23
jackrabbitCoreVersion = 2.21.23
groovyVersion=3.0.17
slf4jVersion = 2.0.7
log4jVersion = 2.20.0
openTracingVersion = 0.33.0
joolVersion = 0.9.14
jetbrainsVersion = 20.1.0
joolVersion = 0.9.15
jetbrainsVersion = 24.1.0

spockVersion = 2.4-M1-groovy-3.0
junitVintageVersion = 5.8.2
testcontainersVersion = 1.16.2
testcontainersVersion = 1.19.5
bndVersion = 6.1.0

revApiOldVersion = 1.0.5
4 changes: 4 additions & 0 deletions ical4j-connector-api/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dependencies {
api "org.mnode.ical4j:ical4j:$ical4jVersion",
"org.mnode.ical4j:ical4j-vcard:$ical4jVCardVersion"
}
13 changes: 13 additions & 0 deletions ical4j-connector-api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module ical4j.connector.api {
requires java.base;

requires transitive ical4j.core;
requires transitive ical4j.vcard;

requires org.slf4j;
requires org.apache.commons.lang3;

exports org.ical4j.connector;
exports org.ical4j.connector.local;
exports org.ical4j.connector.event;
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import net.fortuna.ical4j.vcard.VCardList;
import net.fortuna.ical4j.vcard.filter.VCardFilter;
import net.fortuna.ical4j.vcard.property.Uid;
import org.ical4j.connector.local.LocalCalendarCollection;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
Expand Down Expand Up @@ -121,7 +120,7 @@ default VCardList getCards(String... uids) throws FailedOperationException {
try {
cards.add(getCard(uid));
} catch (ObjectNotFoundException e) {
LoggerFactory.getLogger(LocalCalendarCollection.class).warn("Calendar not found: " + uid);
LoggerFactory.getLogger(CardCollection.class).warn("Calendar not found: " + uid);
}
}
return new VCardList(cards);
Expand Down
15 changes: 10 additions & 5 deletions ical4j-connector-dav/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
dependencies {
api project(":ical4j-connector-api"),
"org.apache.jackrabbit:jackrabbit-webdav:$jackrabbitWebdavVersion",
"org.jetbrains:annotations:$jetbrainsVersion",
"org.jooq:jool-java-8:$joolVersion"
api project(':ical4j-connector-api'),
"org.jetbrains:annotations:$jetbrainsVersion", "org.jooq:jool-java-8:$joolVersion"

implementation 'javax.servlet:servlet-api:2.5'
api("org.apache.httpcomponents:httpclient:$httpclientVersion") {
exclude(group: 'commons-logging', module: 'commons-logging')
}

api("org.apache.jackrabbit:jackrabbit-webdav:$jackrabbitWebdavVersion") {
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
}
implementation 'javax.servlet:servlet-api:2.5', 'org.hamcrest:hamcrest:2.2'
}
20 changes: 20 additions & 0 deletions ical4j-connector-dav/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module ical4j.connector.dav {
requires java.base;
requires java.xml;

requires ical4j.connector.api;

requires org.apache.httpcomponents.httpcore;
requires org.apache.httpcomponents.httpclient;
requires jackrabbit.webdav;

requires org.slf4j;
requires static org.jetbrains.annotations;
requires static org.hamcrest;

exports org.ical4j.connector.dav;
exports org.ical4j.connector.dav.method;
exports org.ical4j.connector.dav.property;
exports org.ical4j.connector.dav.request;
exports org.ical4j.connector.dav.response;
}

0 comments on commit 02efa40

Please sign in to comment.