Skip to content

Commit

Permalink
Merge pull request #286 from commonmark/modular-jar
Browse files Browse the repository at this point in the history
Modular JAR: Add module-info module descriptor and require Java 9+
  • Loading branch information
robinst authored Mar 9, 2024
2 parents 870be81 + af61f14 commit 4db8bba
Show file tree
Hide file tree
Showing 68 changed files with 687 additions and 677 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html),
with the exception that 0.x versions can break between minor versions.

## [Unreleased]
### Changed
- Modular JAR: Require at least Java 11 and add a module descriptor (module-info),
remove no longer necessary `Automatic-Module-Name` header
- New package `org.commonmark.parser.beta` containing classes that are not part of
the stable API but are exported from the module (because they might be useful for
extension parsers).

## [0.21.0] - 2022-11-17
### Added
- GitHub strikethrough: With the previous version we adjusted the
Expand Down Expand Up @@ -379,6 +387,7 @@ API breaking changes (caused by changes in spec):
Initial release of commonmark-java, a port of commonmark.js with extensions
for autolinking URLs, GitHub flavored strikethrough and tables.
[Unreleased]: https://github.com/commonmark/commonmark-java/compare/commonmark-parent-0.21.0...HEAD
[0.21.0]: https://github.com/commonmark/commonmark-java/compare/commonmark-parent-0.20.0...commonmark-parent-0.21.0
[0.20.0]: https://github.com/commonmark/commonmark-java/compare/commonmark-parent-0.19.0...commonmark-parent-0.20.0
[0.19.0]: https://github.com/commonmark/commonmark-java/compare/commonmark-parent-0.18.2...commonmark-parent-0.19.0
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ extensible library with the following features:
* Flexible (manipulate the AST after parsing, customize HTML rendering)
* Extensible (tables, strikethrough, autolinking and more, see below)

The library is supported on Java 11 and later. It should work on Android too,
The library is supported on Java 11 and later. It works on Android too,
but that is on a best-effort basis, please report problems. For Android the
minimum API level is 19, see the
[commonmark-android-test](commonmark-android-test) directory.
[commonmark-android-test](commonmark-android-test)
directory.

Coordinates for core library (see all on [Maven Central]):

Expand All @@ -44,7 +45,8 @@ The module names to use in Java 9 are `org.commonmark`,

Note that for 0.x releases of this library, the API is not considered stable
yet and may break between minor releases. After 1.0, [Semantic Versioning] will
be followed.
be followed. A package containing `beta` means it's not subject to stable API
guarantees yet; but for normal usage it should not be necessary to use.

See the [spec.txt](commonmark-test-util/src/main/resources/spec.txt)
file if you're wondering which version of the spec is currently
Expand Down Expand Up @@ -399,7 +401,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) file.
License
-------

Copyright (c) 2015-2019 Atlassian and others.
Copyright (c) Atlassian and others.

BSD (2-clause) licensed, see LICENSE.txt file.

Expand Down
2 changes: 1 addition & 1 deletion commonmark-android-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Current `minSdk` is 19

Requirements:

* Java 7 or above
* Java 11 or above
* Android SDK 30

Configuration
Expand Down
39 changes: 23 additions & 16 deletions commonmark-android-test/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
namespace "org.commonmark.android.test"
compileSdk 30

defaultConfig {
applicationId "org.commonmark.android.test"
minSdkVersion 19
targetSdkVersion 30
minSdk 19
targetSdk 30
versionCode 1
versionName "1.0"
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

packagingOptions {
Expand All @@ -27,19 +27,26 @@ android {
// we add other modules sources in order for lint to process them (lint operates on sources)
sourceSets {
main {
java.srcDirs += [
'../../commonmark',
'../../commonmark-ext-autolink',
'../../commonmark-ext-gfm-strikethrough',
'../../commonmark-ext-gfm-tables',
'../../commonmark-ext-heading-anchor',
'../../commonmark-ext-ins',
'../../commonmark-ext-yaml-front-matter'
].collect { "$it/src/main/java" }
java {
[
'../../commonmark',
'../../commonmark-ext-autolink',
'../../commonmark-ext-gfm-strikethrough',
'../../commonmark-ext-gfm-tables',
'../../commonmark-ext-heading-anchor',
'../../commonmark-ext-ins',
'../../commonmark-ext-yaml-front-matter'
].forEach { d ->
// don't include module-info files, otherwise we get
// "too many module declarations found"
PatternSet patternSet = new PatternSet().exclude('**/module-info.java')
srcDirs += fileTree("$d/src/main/java").matching(patternSet)
}
}
}
}
}

dependencies {
implementation('org.nibor.autolink:autolink:0.10.0')
implementation('org.nibor.autolink:autolink:0.11.0')
}
2 changes: 1 addition & 1 deletion commonmark-android-test/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<manifest package="org.commonmark.android.test">
<manifest>
<application />
</manifest>
6 changes: 3 additions & 3 deletions commonmark-android-test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath 'com.android.tools.build:gradle:7.4.2'
}
}

allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
}
Expand Down
Binary file modified commonmark-android-test/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 4db8bba

Please sign in to comment.