Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dgautier committed Feb 14, 2024
2 parents 41e53e4 + 33b5199 commit 0ae110e
Show file tree
Hide file tree
Showing 12 changed files with 238 additions and 41 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "maven" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Deploy Snapshots
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: maven
- name: Deploy to Github packages
run: mvn --batch-mode clean deploy -Pgithub,coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to the Maven Central Repository
run: mvn --batch-mode clean deploy -Possrh
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
25 changes: 25 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Verify PR
on:
pull_request:
branches:
- "**"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn --batch-mode verify -Pcoverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
67 changes: 67 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Release New Version
on:
workflow_dispatch:
inputs:
releaseversion:
description: 'Release version'
required: true
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: maven
- run: |
echo "Release version ${{ github.event.inputs.releaseversion }}!"
- name: Set projects Maven version to GitHub Action GUI set version
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}"
- name: Deploy to Github packages
run: mvn --batch-mode clean deploy -Pgithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Set projects Maven version to GitHub Action GUI set version
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}"
- name: Publish to the Maven Central Repository
run: mvn --batch-mode clean deploy -Possrh
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@v4.1.0
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.releaseversion }}
release_name: ${{ github.event.inputs.releaseversion }}
body: |
### Things that changed in this release
${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false

2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ image:https://badges.gitter.im/Join%20Chat.svg[link="https://gitter.im/bodiam/ma
image:https://maven-badges.herokuapp.com/maven-central/nl.jworks.markdown_to_asciidoc/markdown_to_asciidoc/badge.svg?style={style}[link=https://maven-badges.herokuapp.com/maven-central/nl.jworks.markdown_to_asciidoc/markdown_to_asciidoc]
image:https://img.shields.io/github/license/apache/maven.svg?label=License[link=LICENCE]

A small, lightweight converter for Markdown to http://www.asciidoc.org[AsciiDoc] written in Java, and based on http://pegdown.org[Pegdown].
A small, lightweight converter for Markdown to http://www.asciidoc.org[AsciiDoc] written in Java, and based on https://github.com/sirthias/pegdown[Pegdown].

Uses https://github.com/bodiam/markdown-to-asciidoc/tree/master/src/test/resources/nl/jworks/markdown_to_asciidoc[Cucumber tests] as a reusable
set to test conversion between Markdown and AsciiDoc.
Expand Down
64 changes: 28 additions & 36 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.1.4'
ext.kotlin_version = '1.8.0'
repositories {
mavenCentral()
}
Expand All @@ -15,27 +15,26 @@ plugins {
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'application'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'eclipse'

compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "17"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "17"
}
}



group 'nl.jworks.markdown_to_asciidoc'
version '1.1'
version '2.0.0-SNAPSHOT'

sourceCompatibility = targetCompatibility = 1.8
sourceCompatibility = targetCompatibility = 17
defaultTasks 'check'

repositories {
Expand Down Expand Up @@ -88,40 +87,23 @@ bintray {

}

publishing {
publications {
mavenJava(MavenPublication) {
if (plugins.hasPlugin('war')) {
from components.web
} else {
from components.java
}

artifact sourcesJar
artifact javadocJar
}
}
}

dependencies {
compile 'org.pegdown:pegdown:1.6.0'
compile 'org.jsoup:jsoup:1.8.1'

testCompile 'info.cukes:cucumber-picocontainer:1.1.8'
testCompile 'info.cukes:cucumber-junit:1.1.8'
testCompile 'junit:junit:4.12'
testCompile 'org.apache.commons:commons-io:1.3.2'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
}

task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
classifier 'sources'
implementation 'org.pegdown:pegdown:1.6.0'
//We want to use latest parboiled version not the default one provided by pegdown
implementation 'org.parboiled:parboiled-java:1.4.1'
implementation 'org.jsoup:jsoup:1.16.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

testImplementation 'org.apache.commons:commons-io:1.3.2'
testImplementation 'io.cucumber:cucumber-picocontainer:7.11.0'
testImplementation 'io.cucumber:cucumber-junit:7.11.0'
testImplementation 'io.cucumber:cucumber-java:7.11.0'
}

task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
classifier 'javadoc'
java {
withSourcesJar()
withJavadocJar()
}

artifacts {
Expand All @@ -138,3 +120,13 @@ eclipse {
defaultOutputDir = file('build/eclipse')
}
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=1.0.0-SNAPSHOT
version=2.0.0-SNAPSHOT
description=Markdown to AsciiDoc converter for the JVM
19 changes: 16 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>nl.jworks.markdown_to_asciidoc</groupId>
<artifactId>markdown_to_asciidoc</artifactId>
<version>2.0.0-SNAPSHOT</version>

<licenses>
<license>
<name>The Apache License, Version 2.0</name>
Expand Down Expand Up @@ -59,6 +59,8 @@
<java.version>17</java.version>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${java.version}</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<dependencies>
Expand All @@ -71,11 +73,22 @@
<groupId>org.pegdown</groupId>
<artifactId>pegdown</artifactId>
<version>1.6.0</version>
<exclusions>
<exclusion>
<groupId>org.parboiled</groupId>
<artifactId>parboiled-java</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.parboiled</groupId>
<artifactId>parboiled-java</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.1</version>
<version>1.16.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down Expand Up @@ -231,7 +244,7 @@
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/text2confl/text2confl</url>
<url>https://maven.pkg.github.com/markdown-asciidoc/markdown-to-asciidoc</url>
</repository>
</distributionManagement>
</profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,13 @@ public void visit(TableNode node) {
List<TableColumnNode> columns = node.getColumns();

if(ifColumnsHaveAlignmentSpecified(columns)) {
printer.println();
printer.print("[cols=\"");
printer.print(getColumnAlignment(columns));
printer.print("\"]");
printer.println();
} else {
printer.println();
}

printer.print("|===");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,13 @@ class ToAsciiDocSerializerKt @JvmOverloads constructor(private var rootNode: Roo
val columns = node.columns

if (ifColumnsHaveAlignmentSpecified(columns)) {
printer.println()
printer.print("[cols=\"")
printer.print(getColumnAlignment(columns))
printer.print("\"]")
printer.println()
} else {
printer.println()
}

printer.print("|===")
Expand Down
4 changes: 4 additions & 0 deletions src/test/java/nl/jworks/markdown_to_asciidoc/TestSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
import org.junit.Ignore;
import org.junit.Test;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.nio.charset.StandardCharsets;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
Expand Down

0 comments on commit 0ae110e

Please sign in to comment.