Skip to content

Commit

Permalink
Merge pull request #662 from asciidoctor/development-4.x
Browse files Browse the repository at this point in the history
Make 4.x the main development
  • Loading branch information
ysb33r authored Jan 5, 2024
2 parents 0ff9daf + b2a2cba commit 433c9dc
Show file tree
Hide file tree
Showing 275 changed files with 7,212 additions and 4,377 deletions.
106 changes: 35 additions & 71 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,19 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
# Cache
- name: Cache .gradle/caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-cache-
- name: Cache .gradle/wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-wrapper-
distribution: zulu
# Licensing
- name: Licensing
uses: eskatos/gradle-command-action@v1
uses: gradle/gradle-build-action@v2
with:
arguments: --console=plain -S license
# Coding style
- name: Coding style
uses: eskatos/gradle-command-action@v1
uses: gradle/gradle-build-action@v2
with:
arguments: --console=plain -S codenarcAll
build-windows:
Expand All @@ -38,103 +26,79 @@ jobs:
# use a short path to avoid exceeding the path limit on Windows... sigh
with:
path: 'w'
- uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
java-version: 11
# Cache
- name: Cache .gradle/caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-cache-
- name: Cache .gradle/wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-wrapper-
distribution: zulu
- name: Cache offline repository
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: testfixtures/offline-repo/build/repo
key: ${{ runner.os }}-offline-repo-${{ hashFiles('module-versions.properties') }}
restore-keys: ${{ runner.os }}-offline-repo-
# Build
- name: Build offline repository
uses: eskatos/gradle-command-action@v1
uses: gradle/gradle-build-action@v2
with:
arguments: --console=plain --no-build-cache :testfixtures-offline-repo:buildOfflineRepositories
- name: Build
uses: eskatos/gradle-command-action@v1
uses: gradle/gradle-build-action@v2
with:
arguments: --console=plain --warning-mode=all -s clean assemble
# Test
# TODO: Resolve the gem integration test issue. See https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/694
- name: Test
uses: eskatos/gradle-command-action@v1
uses: gradle/gradle-build-action@v2
with:
arguments: --console=plain --warning-mode=all -s check --no-parallel -Djava.net.preferIPv4Stack=true -x gradleTest --scan
# Documentation
- name: Documentation
uses: eskatos/gradle-command-action@v1
with:
build-root-directory: docs
arguments: asciidoctor
arguments: --console=plain --warning-mode=all -s check --no-parallel -Djava.net.preferIPv4Stack=true -x gradleTest -x :asciidoctor-gradle-jvm-gems:IntTest --scan
# Stop gradlew to avoid locking issues
- name: Cleanup
uses: eskatos/gradle-command-action@v1
uses: gradle/gradle-build-action@v2
with:
arguments: --stop
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
java: [ 8, 11 ]
os: [ubuntu-latest]
java: [ 8 ]
# os: [ubuntu-latest, macos-latest]
# java: [ 8, 11 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
# Cache
- name: Cache .gradle/caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-cache-
- name: Cache .gradle/wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-wrapper-
distribution: zulu
- name: Cache offline repository
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: testfixtures/offline-repo/build/repo
key: ${{ runner.os }}-offline-repo-${{ hashFiles('module-versions.properties') }}
restore-keys: ${{ runner.os }}-offline-repo-
- name: Build offline repository
uses: eskatos/gradle-command-action@v1
uses: gradle/gradle-build-action@v2
with:
arguments: --console=plain --no-build-cache :testfixtures-offline-repo:buildOfflineRepositories
# Build
- name: Build
uses: eskatos/gradle-command-action@v1
uses: gradle/gradle-build-action@v2
with:
arguments: -i -S --console=plain --no-build-cache assemble
# Integration tests
- name: Integration tests (without slides)
uses: eskatos/gradle-command-action@v1
with:
arguments: -i -s --console=plain --no-build-cache test intTest remoteTest -x asciidoctor-gradle-slides-export:intTest -x asciidoctor-gradle-jvm-slides:intTest
- name: Integration tests (slides only)
uses: eskatos/gradle-command-action@v1
uses: gradle/gradle-build-action@v2
with:
arguments: -i -s --console=plain --no-build-cache test asciidoctor-gradle-jvm-slides:intTest asciidoctor-gradle-slides-export:intTest
arguments: -i -s --console=plain --no-build-cache test intTest remoteTest --scan
# arguments: -i -s --console=plain --no-build-cache test intTest remoteTest -x asciidoctor-gradle-jvm-slides:intTest
# arguments: -i -s --console=plain --no-build-cache test intTest remoteTest -x asciidoctor-gradle-slides-export:intTest -x asciidoctor-gradle-jvm-slides:intTest
# TODO: See https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/695
# - name: Integration tests (slides only)
# uses: eskatos/gradle-command-action@v2
# with:
# arguments: -i -s --console=plain --no-build-cache test asciidoctor-gradle-jvm-slides:intTest asciidoctor-gradle-slides-export:intTest
# Gradle tests
- name: Gradle tests
uses: eskatos/gradle-command-action@v1
uses: gradle/gradle-build-action@v2
with:
arguments: -i -s --console=plain --no-build-cache gradleTest
arguments: -i -s --console=plain --no-build-cache gradleTest --scan
22 changes: 5 additions & 17 deletions .github/workflows/push-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,18 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
# Cache
- name: Cache .gradle/caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-cache-
- name: Cache .gradle/wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-wrapper-
distribution: zulu
- name: Combine documentation
uses: eskatos/gradle-command-action@v1
uses: gradle/gradle-build-action@v2
with:
build-root-directory: docs
arguments: --console=plain -q combineDocs
- name: Publish documentation
uses: eskatos/gradle-command-action@v1
uses: gradle/gradle-build-action@v2
with:
build-root-directory: docs
arguments: "--console=plain --info :antora:publishDocs :gh-pages:publishDocs
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ out
buildSrc/gradle/wrapper
buildSrc/gradlew*
.asciidoctor-module-versions.generated

.generated-src/
# Because we auto-generate this from the main project
# and it is only needed for IntelliJ
docs/gradle/wrapper
Expand Down
40 changes: 2 additions & 38 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ test:integration_slides:
expire_in: 10 days
when: on_failure

test:gradle_4.9,4.10.2:
test:gradle_7.0.2,7.1.1,7.3.3:
stage: test
image: $JDK11_TEST_IMAGE
except:
Expand All @@ -136,43 +136,7 @@ test:gradle_4.9,4.10.2:
expire_in: 10 days
when: on_failure

test:gradle_5.0,5.1.1,5.3.1:
stage: test
image: $JDK11_TEST_IMAGE
except:
- pages
- gh-pages
- tags
dependencies:
- testrepo
- jdk11
script: ./run-compatibility-test-on-ci.sh
artifacts:
paths:
- '*/build/reports'
- '*/build/jacoco'
expire_in: 10 days
when: on_failure

test:gradle_5.4.1,5.5.1,5.6.4:
stage: test
image: $JDK12_TEST_IMAGE
except:
- pages
- gh-pages
- tags
dependencies:
- testrepo
- jdk11
script: ./run-compatibility-test-on-ci.sh
artifacts:
paths:
- '*/build/reports'
- '*/build/jacoco'
expire_in: 10 days
when: on_failure

test:gradle_6.0.1:
test:gradle_7.4.2,7.5.1:
stage: test
image: $JDK12_TEST_IMAGE
except:
Expand Down
3 changes: 3 additions & 0 deletions .sdkmanrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=8.0.302-open
12 changes: 8 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= Asciidoctor Gradle Plugin
Andres Almiray <https://github.com/aalmiray[@aalmiray]>
:version: 3.3.2
:version-published: 3.3.2
:version: 4.0.0
:version-published: 4.0.0-alpha.1
:asciidoc-url: http://asciidoc.org
:asciidoctor-url: http://asciidoctor.org
:issues: https://github.com/asciidoctor/asciidoctor-maven-plugin/issues
Expand All @@ -20,7 +20,7 @@ Andres Almiray <https://github.com/aalmiray[@aalmiray]>
:plugin-name: Asciidoctor Gradle plugin
:project-name: asciidoctor-gradle-plugin
:project-full-path: asciidoctor/asciidoctor-gradle-plugin
:github-branch: development-3.x
:github-branch: development-4.x
:linkattrs:
ifndef::env-github[:icons: font]
ifdef::env-github,env-browser[]
Expand All @@ -47,6 +47,10 @@ The {doctitle} is the official means of using {asciidoctor-url}[Asciidoctor] to
Documentation:: We are migrating our documentation to the new Asciidoctor Antora-based site when it is ready. In the meantime you can read a snapshot of the new documentation at {asciidoctor-development-docs}{github-branch}

ifdef::env-github[]
Structure:: `master` now represents the code for the latest 3.x release of these plugins. Development for 3.x is against the link:https://github.com/asciidoctor/asciidoctor-gradle-plugin/tree/development-3.x[{github-branch}] branch. PRs are preferably taking against this branch. The 2.x & 1.5.x series of the plugin is now in maintenance only mode. PRs for that should be raised against the respective link:https://github.com/asciidoctor/asciidoctor-gradle-plugin/tree/maintenance-2.x[maintenance-2.x] and https://github.com/asciidoctor/asciidoctor-gradle-plugin/tree/maintenance-1.5[maintenance-1.5] branches.
Structure:: `master` now represents the code for the latest 3.x release of these plugins.
Development for 4.x is against the link:https://github.com/asciidoctor/asciidoctor-gradle-plugin/tree/development-4.x[{github-branch}] branch.
PRs are preferably taking against this branch.
The 3.x series of the plugin is now in maintenance only mode.
PRs for that should be raised against the link:https://github.com/asciidoctor/asciidoctor-gradle-plugin/tree/maintenance-3.x[maintenance-3.x]branches.
endif::[]

19 changes: 10 additions & 9 deletions asciidoctoreditorconfig/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
configurations {
additionalPluginClasspath
agProject {
withAdditionalPluginClasspath()

configurePlugin(
'org.asciidoctor.editorconfig',
'Asciidoctor Editor Config Plugin',
'Generate .asciidoctorconfig files for use by supported IDEs',
'org.asciidoctor.gradle.editorconfig.AsciidoctorEditorConfigPlugin',
['intellij', 'idea']
)
}

dependencies {
implementation project(':asciidoctor-gradle-base')
additionalPluginClasspath project(':asciidoctor-gradle-jvm')
}

pluginUnderTestMetadata {
pluginClasspath.from configurations.additionalPluginClasspath
}

configurePlugin 'org.asciidoctor.editorconfig',
'Asciidoctor Editor Config Plugin',
'Generate .asciidoctorconfig files for use by supported IDEs',
['asciidoctor', 'intellij', 'idea']

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2021 the original author or authors.
* Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,7 +31,7 @@ class AsciidoctorEditorConfigIntegrationSpec extends FunctionalSpecification {
String groupName = 'the.group'
String projVer = '1.0.0'

File attrFile = new File(testProjectDir.root, 'inputs.adoc')
File attrFile = new File(projectDir, 'inputs.adoc')
attrFile.text = ":${key3}: ${value3}\n"

getGroovyBuildFile("""
Expand All @@ -51,23 +51,23 @@ class AsciidoctorEditorConfigIntegrationSpec extends FunctionalSpecification {
}
""")

File outputFile = new File(testProjectDir.root, '.asciidoctorconfig')
new File(testProjectDir.root, 'settings.gradle').text = "rootProject.name='${projName}'"
File outputFile = new File(projectDir, '.asciidoctorconfig')
settingsFile.text = "rootProject.name='${projName}'"

when:
getGradleRunner(['asciidoctorEditorConfig']).build()

then:
normalisedLineEndings(outputFile.text) == """:${key1}: ${value1}
:gradle-project-name: ${projName}
:gradle-project-group: ${groupName}
:gradle-project-version: ${projVer}
:gradle-project-name: ${projName}
:${key2}: ${value2}
:gradle-project-group: ${groupName}
:${key3}: ${value3}
"""
}

String normalisedLineEndings(String text) {
text.replaceAll('\\r', '')
}
}
}
Loading

0 comments on commit 433c9dc

Please sign in to comment.