-
Couldn't load subscription status.
- Fork 98
Replace Ant build with Gradle build #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👍 I compared the output generated by the 💥 The new build not only generates the platform filter file, but also applies it to each target, so no content with This was certainly the original intent, but it appears the Ant build never actually applied the generated filter file (presumably to ensure distribution builds include all content, regardless of the platform on which they are run). So the new build is working as intended, but exposes errors in the logic elsewhere. For example on macOS, an empty table is produced for http://www.dita-ot.org/dev/user-guide/increasing-the-jvm.html. That table uses But the filtering routine seems to ignore this definition and exclude the row, since the current platform is not literally If the source file is changed to ❓@jelovirt: Should the filtering process be respecting the subjectScheme? If this is a bug, I'll file a separate issue in the core repo, but I'm not sure if it's an error in the docs source files. Disable filters in distribution buildsI think the solution here is to simply remove the I'd be inclined to leave the filter active in the |
|
@jelovirt Merging this will require changes to the distribution build task in the core repo, so we may want to coordinate the timing of the merge to minimize errors. |
|
I can remove the filters for the PDF and HTML builds. I'll do it when I get the chance. I also need to modify |
Sure, feel free to update the branch if you have time. If not, I can do that right after we merge this.
Good point, hadn't thought of that yet. |
|
Also confirmed this new build file works with Markdown input. 👍 |
|
Should we just remove the |
|
Also, in And in the current def ditaHomeSrc = project.hasProperty("ditaHomeSrc") ? file("${ditaHomeSrc}") : file("${ditaHome}")
def configDir = "$ditaHomeSrc/config"But my PR (inadvertently) removes the I don't quite understand its purpose. Could you enlighten me on that so that I can put it back (in some form or another)? |
I'd be inclined to keep it, as this approach may serve as a useful example to others with similar requirements. I'd just remove the filters for the PDF and HTML builds. As for the purpose of the So we use a stable toolkit to run the build, but generate topics from the bleeding edge source files. |
Sure thing. One thing to note, though, is that if you generate HTML Help output on a non-Windows platform, the resulting output will have non-Windows content, too.
OK, I see — thanks for the explanation. I'll modify |
Theoretically yes, but the risk is low, since the HTML Help Workshop required to compile the CHM is Windows-only software. (Not sure how many would generate output on Linux/macOS for subsequent compilation on Windows, but the result would be extra content rather than data loss, so little danger.) |
c146e96 to
e04ddc6
Compare
|
I pushed the changes and cleaned up a few things. If you have the time, please give it another go. If you can, you could also test using The CI build seems to be passing, now, too. Note that when you invoke Gradle after these changes, you have to use |
|
I get a new message that I haven't seen before, but the build seems to complete successfully: There are issues with missing conrefs in the PDF output (empty bullets on page 12, for example), but this is apparently related to upstream changes in the conref processing, as the same issues appear when building with Ant using dita-ot/dita-ot@19abe1998. The content appears as expected when building with the @jelovirt Can you update the distribution builds to use this new Gradle build for docs instead of Ant? |
DITA-OT itself tries to load that property file, so I think it must be unrelated to this change. Not sure why that popped up for you all of a sudden, though. Also not sure why that file is missing. |
|
👍 This has the added benefit of significantly faster distribution builds for docs (~42s). We plan to merge this in for 3.0.1. |
e04ddc6 to
ba2bb37
Compare
|
I pushed one last change that updates the DITA-OT Gradle Plugin to version 0.4.3. That should fix the problems with |
|
Pull request inadvertently closed when the Reopened and based on |
build.gradle
Outdated
|
|
||
| task messages(type: SaxonXsltTask) { | ||
| input "${configDir}/messages.xml" | ||
| output 'user-guide/DITA-messages.xml' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and others assume the current repository is the docs repo or docsrc inside DITA-OT. This should be configurable with a paragraph, so that we can run Gradle from any random directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you mean that you should be able to do something like gradle -b ~/Git/docs/build.gradle -PditaHome=$DITA_HOME site, too, which you currently can't?
If so, I agree, and I pushed the changes.
ba2bb37 to
a6da39d
Compare
|
Tested a6da39d, verified the following:
✅ This should be suitable for use in DITA-OT distribution builds. |
build.gradle
Outdated
| doLast { | ||
| antBuilder.execute { | ||
| ant(antfile: 'build.xml', target: 'pdf') | ||
| String ditaHome = getPropertyOrDefault('ditaHome', '../') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be something like
String ditaHome = getPropertyOrDefault('ditaHome', buildscript.sourceFile.getParentFile().getParentFile().getAbsolutePath())
This way the default we would not need to define the ditaHome property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Signed-off-by: Eero Helenius <eero.helenius@kapsi.fi>
a6da39d to
55466c2
Compare
Per #178 Signed-off-by: Roger Sheen <roger@infotexture.net>
Replaced with a Gradle build for 3.1 in #178. Signed-off-by: Roger Sheen <roger@infotexture.net>
When the docs Ant build was replaced with the new Gradle build for #178, the `generate-properties-file` target created for 2.3 with #60 was inadvertently left behind. Since the distribution build for the core repo was updated to use the docs Gradle build for 3.1 per dita-ot/dita-ot#2972, this file is no longer generated when the docs build runs. This commit ports the missing target from the old Ant build to the current Gradle build file to ensure that the template is once again available in the `docsrc/samples/properties/` directory of distribution builds. Signed-off-by: Roger Sheen <roger@infotexture.net>
When the docs Ant build was replaced with the new Gradle build for #178, the `generate-properties-file` target created for 2.3 with #60 was inadvertently left behind. Since the distribution build for the core repo was updated to use the docs Gradle build for 3.1 per dita-ot/dita-ot#2972, this file is no longer generated when the docs build runs. This commit ports the missing target from the old Ant build to the current Gradle build file to ensure that the template is once again available in the `docsrc/samples/properties/` directory of distribution builds. Signed-off-by: Roger Sheen <roger@infotexture.net>
The properties files were originally created in 9cceb75 to allow the same properties to be used in both Ant and Gradle builds. The legacy Ant build was removed ac79e97 for #178, so there's no longer any need to maintain properties files that are separate from the build script. Since ffd660f, properties that require absolute paths are set in the Gradle build to anchor these paths to the Gradle project directory, which corresponds to the `docsrc/` folder of the DITA-OT distribution package, or the root folder of the docs repository when cloned to a standalone location. This supports location-independent builds in a more reliable fashion than the previous mechanism that relied on the Ant `${basedir}` property, which is interpreted differently in recent Gradle and JDK versions. Signed-off-by: Roger Sheen <roger@infotexture.net>
Signed-off-by: Eero Helenius eero.helenius@kapsi.fi