Remove asciidoctorj-pdf submodule in favor of separate repo
MODIFY
asciidoctorj-distribution/build.gradle
asciidoctorj-distribution/build.gradle
@@ -8,8 +8,10 @@ dependencies {
compile project(':asciidoctorj')
compile project(':asciidoctorj-diagram')
compile project(':asciidoctorj-epub3')
- compile project(':asciidoctorj-pdf')
+ compile("org.asciidoctor:asciidoctorj-pdf:$asciidoctorjPdfVersion") {
+ transitive = false
+ }
compile 'org.jruby:jruby-complete:9.1.8.0'
}

DELETE
asciidoctorj-pdf/build.gradle
-
-ext {
- jrubyVersion = '9.1.8.0'
-}
-
-dependencies {
- compile(project(':asciidoctorj')) {
- exclude module: 'jruby-complete'
- }
-
- compile "org.jruby:jruby-complete:$jrubyVersion"
-
-
- gems("rubygems:asciidoctor-pdf:$asciidoctorPdfGemVersion") {
- // Exclude gems provided by AsciidoctorJ core
- exclude module: 'asciidoctor'
- exclude module: 'thread_safe'
- // We must lock Prawn to 1.3.0 until AsciidoctorJ upgrades to JRuby 9.0.0.0
- exclude module: 'prawn'
- exclude module: 'addressable'
- exclude module: 'public_suffix'
- }
- gems "rubygems:prawn:$prawnGemVersion"
- gems "rubygems:rouge:$rougeGemVersion"
- gems "rubygems:addressable:$addressableVersion"
- gems "rubygems:public_suffix:$public_suffixVersion"
-}
-
-def gemFiles = fileTree(jruby.gemInstallDir) {
- include 'specifications/*.gemspec'
- include 'gems/*/lib/**'
- include "gems/*/data/fonts/**"
- include "gems/asciidoctor-pdf-$asciidoctorPdfGemVersion/data/**"
- // Accomodate Prawn's non-conforming packaging
- include "gems/prawn-$prawnGemVersion/VERSION"
- include "gems/prawn-$prawnGemVersion/data/*.txt"
- include "gems/prawn-$prawnGemVersion/data/encodings/*"
- // Include icon fonts
- include "gems/prawn-icon-*/fonts/*/*"
- // Include required data file from the addressable gem
- include "gems/addressable-*/data/*.data"
-
- exclude 'gems/rouge-*/lib/rouge/demos/**'
-}
-
-jruby {
- defaultRepositories = false
- defaultVersion = jrubyVersion
- execVersion = jrubyVersion
- // TODO I'd like to be able to customize the name of the gemInstallDir
-}
-
-jrubyPrepare << {
- copy { // bundles the gems inside this artifact
- from gemFiles
- into sourceSets.main.output.resourcesDir
- }
-}

DELETE
asciidoctorj-pdf/gradle.properties
-properName=AsciidoctorJ PDF
-description=AsciidoctorJ PDF bundles the Asciidoctor PDF RubyGem (asciidoctor-pdf) so it can be loaded into the JVM using JRuby.
-version=1.5.0-alpha.14
-gem_name=asciidoctor-pdf

DELETE
asciidoctorj-pdf/src/test/java/org/asciidoctor/WhenBackendIsPdf.java
-package org.asciidoctor;
-
-import static org.asciidoctor.OptionsBuilder.options;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.io.File;
-
-import org.asciidoctor.Asciidoctor;
-import org.asciidoctor.util.ClasspathResources;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.Ignore;
-
-public class WhenBackendIsPdf {
-
- private Asciidoctor asciidoctor = Asciidoctor.Factory.create();
-
- @Rule
- public ClasspathResources classpath = new ClasspathResources();
-
- @Test
- public void pdf_should_be_rendered_for_pdf_backend() {
- File inputFile = classpath.getResource("sample.adoc");
- File outputFile1 = new File(inputFile.getParentFile(), "sample.pdf");
- asciidoctor.convertFile(inputFile, options().backend("pdf").get());
- assertThat(outputFile1.exists(), is(true));
- outputFile1.delete();
- }
-}

DELETE
asciidoctorj-pdf/src/test/java/org/asciidoctor/util/ClasspathHelper.java
-package org.asciidoctor.util;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-/**
- * Hels getting files from the classpath.
- */
-public class ClasspathHelper {
-
- private ClassLoader classloader;
-
- /**
- * Gets a resourse in a similar way as {@link File#File(String)}
- */
- public File getResource(String pathname) {
- try {
- URL resource = classloader.getResource(pathname);
- if (resource != null) {
- return new File(classloader.getResource(pathname).toURI());
- }
- else {
- throw new RuntimeException(new FileNotFoundException(pathname));
- }
- } catch (URISyntaxException e) {
- throw new RuntimeException(e.getMessage(), e);
- }
- }
-
- /**
- * Gets a resourse in a similar way as {@link File#File(String, String)}
- */
- public File getResource(String parent, String child) {
- return new File(getResource(parent), child);
- }
-
- public ClassLoader getClassloader() {
- return classloader;
- }
-
- public void setClassloader(ClassLoader classloader) {
- this.classloader = classloader;
- }
-
- public void setClassloader(Class<?> clazz) {
- this.classloader = clazz.getClassLoader();
- }
-}

DELETE
asciidoctorj-pdf/src/test/java/org/asciidoctor/util/ClasspathResources.java
-package org.asciidoctor.util;
-
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runners.model.Statement;
-
-/**
- * JUnit TestRule to handle classpath files.
- *
- * Delegates to {@link ClasspathHelper}
- */
-public class ClasspathResources extends ClasspathHelper implements TestRule {
-
- protected void before(Class<?> clazz) throws Throwable {
- super.setClassloader(clazz);
- }
-
- @Override
- public Statement apply(final Statement base, final Description description) {
- return new Statement() {
- @Override
- public void evaluate() throws Throwable {
- before(description.getTestClass());
- base.evaluate();
- }
- };
- }
-}

DELETE
asciidoctorj-pdf/src/test/resources/sample.adoc
-= Document Title
-:source-highlighter: rouge
-
-Content.
-
-[source,java]
-----
-System.out.println("Hello, World!");
-----

MODIFY
build.gradle
build.gradle
@@ -34,6 +34,7 @@ ext {
statusIsRelease = (status == 'release')
// jar versions
+ asciidoctorjPdfVersion = '1.5.0-alpha.15'
guavaVersion = '18.0'
hamcrestVersion = '1.3'
jcommanderVersion = '1.35'
@@ -46,7 +47,6 @@ ext {
// gem versions
asciidoctorGemVersion = project.hasProperty('asciidoctorGemVersion') ? project.asciidoctorGemVersion : '1.5.5'
asciidoctorEpub3GemVersion = project(':asciidoctorj-epub3').version.replace('-', '.')
- asciidoctorPdfGemVersion = project(':asciidoctorj-pdf').version.replace('-', '.')
asciidoctorDiagramGemVersion = project(':asciidoctorj-diagram').version.replace('-', '.')
addressableVersion = '2.4.0'
@@ -56,12 +56,9 @@ ext {
erubisGemVersion = '2.7.0'
hamlGemVersion = '4.0.5'
openUriCachedGemVersion = '0.0.5'
- prawnGemVersion = '2.1.0'
- rougeGemVersion = '1.11.1'
slimGemVersion = '3.0.6'
threadSafeGemVersion = '0.3.5'
tiltGemVersion = '2.0.1'
- ttfunkGemVersion = '1.2.2'
}
allprojects {

MODIFY
settings.gradle
settings.gradle
@@ -4,7 +4,6 @@ include \
'asciidoctorj',
'asciidoctorj-diagram',
'asciidoctorj-epub3',
- 'asciidoctorj-pdf',
'asciidoctorj-distribution'
project(':asciidoctorj').projectDir = file('asciidoctorj-core')

Remove asciidoctorj-pdf submodule in favor of separate repo