Permalink
Browse files

Fix for #137 making target directory mandatory for initialization

  • Loading branch information...
jakubjab committed Jan 24, 2018
1 parent 1a025a0 commit 423248f7ca68306e87d292ee9266b4d5472e9359
Showing with 28 additions and 28 deletions.
  1. +4 −4 docs/index.html
  2. +20 −20 init.gradle
  3. +4 −4 src/docs/manual/02_install.adoc
View
@@ -783,7 +783,7 @@ <h3 id="_get_the_tool">2.1. Get the tool</h3>
<h3 id="_initialize_directory_for_documents">2.2. Initialize directory for documents</h3>
<div class="paragraph">
<p>The next step after getting docToolchain is to initialize a directory where your documents live. In docToolchain this
directory is named "docDir".</p>
directory is named "newDocDir" during initialization, or just "docDir" later on.</p>
</div>
<div class="sect3">
<h4 id="_existing_documents">2.2.1. Existing documents</h4>
@@ -796,7 +796,7 @@ <h4 id="_existing_documents">2.2.1. Existing documents</h4>
<div class="title">Linux initExisting example</div>
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">cd &lt;docToolchain home&gt;
./gradlew -b init.gradle initExisting -PdocDir=&lt;your directory&gt;</code></pre>
./gradlew -b init.gradle initExisting -PnewDocDir=&lt;your directory&gt;</code></pre>
</div>
</div>
<div class="paragraph">
@@ -828,7 +828,7 @@ <h4 id="_arc42_from_scratch">2.2.2. Arc42 from scratch</h4>
<div class="title">Linux initArc42EN example</div>
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">cd &lt;docToolchain home&gt;
./gradlew -b init.gradle initArc42EN -PdocDir=&lt;docDir&gt;</code></pre>
./gradlew -b init.gradle initArc42EN -PnewDocDir=&lt;newDocDir&gt;</code></pre>
</div>
</div>
<div class="paragraph">
@@ -3360,7 +3360,7 @@ <h2 id="_acknowledgements_and_contributors">6. Acknowledgements and Contributors
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-11-18 20:07:32 CET
Last updated 2018-01-24 21:01:10 CET
</div>
</div>
</body>
View
@@ -16,78 +16,78 @@ apply plugin:'groovy'
//tag::initExisting[]
task initExisting(
description: 'Install template configuration file and helper scripts in docDir',
description: 'Install template configuration file and helper scripts in newDocDir',
group: 'docToolchain'
) doLast {
copy {
from "${projectDir}/template_config"
into docDir
into newDocDir
}
}
//end::initExisting[]
//tag::initArc42DE[]
task initArc42DE(
description: 'Download German arc42 template from GitHub into docDir',
description: 'Download German arc42 template from GitHub into newDocDir',
group: 'docToolchain',
dependsOn: 'initExisting'
) doLast {
download {
src 'https://github.com/arc42/arc42-template/raw/master/dist/arc42-template-DE-withhelp-asciidoc.zip'
dest new File(docDir, 'arc42-template-DE-withhelp-asciidoc.zip')
dest new File(newDocDir, 'arc42-template-DE-withhelp-asciidoc.zip')
}
copy {
from zipTree(new File(docDir, 'arc42-template-DE-withhelp-asciidoc.zip'))
into docDir
from zipTree(new File(newDocDir, 'arc42-template-DE-withhelp-asciidoc.zip'))
into newDocDir
}
delete {
delete new File(docDir, 'arc42-template-DE-withhelp-asciidoc.zip')
delete new File(newDocDir, 'arc42-template-DE-withhelp-asciidoc.zip')
}
logger.info "arc42 template unpacked into ${docDir}"
logger.info "arc42 template unpacked into ${newDocDir}"
}
//end::initArc42DE[]
//tag::initArc42EN[]
task initArc42EN(
description: 'Download English arc42 template from GitHub into docDir',
description: 'Download English arc42 template from GitHub into newDocDir',
group: 'docToolchain',
dependsOn: 'initExisting'
) doLast {
download {
src 'https://github.com/arc42/arc42-template/raw/master/dist/arc42-template-EN-withhelp-asciidoc.zip'
dest new File(docDir, 'arc42-template-EN-withhelp-asciidoc.zip')
dest new File(newDocDir, 'arc42-template-EN-withhelp-asciidoc.zip')
}
copy {
from zipTree(new File(docDir, 'arc42-template-EN-withhelp-asciidoc.zip'))
into docDir
from zipTree(new File(newDocDir, 'arc42-template-EN-withhelp-asciidoc.zip'))
into newDocDir
}
delete {
delete new File(docDir, 'arc42-template-EN-withhelp-asciidoc.zip')
delete new File(newDocDir, 'arc42-template-EN-withhelp-asciidoc.zip')
}
logger.info "arc42 template unpacked into ${docDir}"
logger.info "arc42 template unpacked into ${newDocDir}"
}
//end::initArc42EN[]
//tag::initArc42ES[]
task initArc42ES(
description: 'Download Spanish arc42 template from GitHub into docDir',
description: 'Download Spanish arc42 template from GitHub into newDocDir',
group: 'docToolchain',
dependsOn: 'initExisting'
) doLast {
download {
src 'https://github.com/arc42/arc42-template/raw/master/dist/arc42-template-ES-withhelp-asciidoc.zip'
dest new File(docDir, 'arc42-template-ES-withhelp-asciidoc.zip')
dest new File(newDocDir, 'arc42-template-ES-withhelp-asciidoc.zip')
}
copy {
from zipTree(new File(docDir, 'arc42-template-ES-withhelp-asciidoc.zip'))
into docDir
from zipTree(new File(newDocDir, 'arc42-template-ES-withhelp-asciidoc.zip'))
into newDocDir
}
delete {
delete new File(docDir, 'arc42-template-ES-withhelp-asciidoc.zip')
delete new File(newDocDir, 'arc42-template-ES-withhelp-asciidoc.zip')
}
logger.info "arc42 template unpacked into ${docDir}"
logger.info "arc42 template unpacked into ${newDocDir}"
}
//end::initArc42ES[]
@@ -58,19 +58,19 @@ You can add <docToolchain home>/bin to your PATH or you can run doctoolchain wit
== Initialize directory for documents
The next step after getting docToolchain is to initialize a directory where your documents live. In docToolchain this
directory is named "docDir".
directory is named "newDocDir" during initialization, or just "docDir" later on.
=== Existing documents
If you already have some existing documents in asciidoc format in your project, you need to put the configuration
file there to inform docToolchain what and how to process. You can do that manually by copying the contents of
file there to inform docToolchain what and how to process. You can do that manually by copying the contents of
template_config directory. You can also do that by running `initExisting` task.
.Linux initExisting example
[source, bash]
----
cd <docToolchain home>
./gradlew -b init.gradle initExisting -PdocDir=<your directory>
./gradlew -b init.gradle initExisting -PnewDocDir=<your directory>
----
You need to open Config.groovy file and configure names of your files properly.
@@ -90,7 +90,7 @@ format. You can do that by manually downloading from http://arc42.org/download.
[source, bash]
----
cd <docToolchain home>
./gradlew -b init.gradle initArc42EN -PdocDir=<docDir>
./gradlew -b init.gradle initArc42EN -PnewDocDir=<newDocDir>
----
The Config.groovy file is then preconfigured to use the downloaded template.

0 comments on commit 423248f

Please sign in to comment.