Skip to content

Commit 1742622

Browse files
committed
updated
1 parent 5bcb667 commit 1742622

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

README.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,24 @@ __7.0.3 (13-sep-2020)__
3333

3434
# Introduction
3535

36-
Since 2001 I was strongly involved in development for J2ME mobile devices, it was too expensive to support the same
37-
sources for different devices if to use standard Java OOP approach, so that I choosed C/C++ approach and developed
38-
preprocessor which made my life much easier. Inintially it was a proprietary project but since 2011 it became OSS
39-
project.
36+
Initially the tool developed for J2ME game development in 2002. It was too expensive for me to support multiple sources for many J2ME devices especially if it was needed just change position of several calls for different devices. So the preprocessor was born and because Java is the main technology in use, it is sharpened for use with C/Java family languages (which have import sections and C-comment style). For long time the preprocessor was proprietary project but since 2011 it was opened as an OSS project.
4037

41-
I guess, at present it is the most powerful Java preprocessor with support of two-pass preprocessing, document part support, loops and even use XML files as data sources ([I generated static files with it](jcp-tests/jcp-test-static-site)). Now it is implemented as a fat-jar and includes Maven, ANT and Gradle interfaces and can be used with these tools. For work it needs JDK 1.8+.
38+
I guess, at present it is the most powerful two-pass Java preprocessor which aware for document structure (prefix, body and postfix), loops and even can use XML files as data sources ([I used to generate static web-sites with it](jcp-tests/jcp-test-static-site)). At present the preprocessor represented as a solid uber-jar including Maven, ANT and Gradle interface code and can be used with these tools as their plugin. Minimal required JDK is 1.8
4239

43-
# Documap
40+
# Mind map with all options
4441

45-
![Documap](assets/documap.png)
42+
![Mind map of preprocessor options](assets/documap.png)
4643

4744
# How to use
4845

4946
The Preprocessor can work as:
50-
- a CLI tool
51-
- a Java library
52-
- [a Maven goal](jcp-tests/jcp-test-maven)
53-
- [an ANT task](jcp-tests/jcp-test-ant)
54-
- [a Gradle task](jcp-tests/jcp-test-gradle)
47+
- CLI tool
48+
- Java JAR-library
49+
- [Maven goal](jcp-tests/jcp-test-maven)
50+
- [ANT task](jcp-tests/jcp-test-ant)
51+
- [Gradle task](jcp-tests/jcp-test-gradle)
5552

56-
The Preprocessor is published in the Maven Central (it is not published in Gradle central, so that use the Maven central)
53+
The preprocessor has been published in [the Maven Central](https://search.maven.org/artifact/com.igormaznitsa/jcp).
5754
```
5855
<build>
5956
<plugins>
@@ -78,11 +75,11 @@ The Preprocessor is published in the Maven Central (it is not published in Gradl
7875
```
7976

8077
# How to use from command line
81-
The Preprocessor jar can be started under Java as a console application. Let's take a look at short example below how to start in command line under Linux The Easy variant of usage:
78+
The uber-jar can be started directly under Java as through CLI interface. Let's take a look at short example below how to start in command line under Linux The Easy variant of usage:
8279
```
8380
java -jar jcp-7.0.4.jar --i:./test --o:./result
8481
```
85-
The Example just preprocess files from ./test folder which extensions allowed to be preprocessed by default, and places result into ./result folder, but keep in your mind that the preprocessor copies not all files, XML files will not be preprocessed by default. Files which extension are not marked for preprocessing will be just copied (of course if the extensions is not in the list of excluded file extensions)
82+
The example above just preprocessing files from ./test folder (which extensions allowed to be preprocessed by default), and placing result files into ./result folder. Keep in your mind that the preprocessor processing not all files, for instance XML files will not be preprocessed by default. Files which extension not marked for preprocessing will be just copied (of course if the extensions is not in the excluded extension list)
8683

8784
More complex example:
8885
```
@@ -99,14 +96,14 @@ java -jar jcp-7.0.4.jar --c --r --v --f:java,xml --ef:none --i:./test --o:./res
9996
- --z turn on checking of file content before replacement, if the same content then preprocessor will not replace the file
10097
- --es allow whitespace between comment and directive (by default it is turned off)
10198

102-
# Internal test examples
99+
# Some examples
103100
- [Prepare sources for Javassist](jcp-tests/jcp-test-javassist)
104101
- [Make multi-versioned JAR for JEP-238](jcp-tests/jcp-test-jep238)
105102
- [Generate static file from XML sources](jcp-tests/jcp-test-static-site)
106103
- [Simple Android Gradle-based project](jcp-tests/jcp-test-android)
107104

108105
# Example of Java sources with directives
109-
In Java the only allowed way to inject directives and to not break work of tools and conpilers - is to use commented space, so that the preprocessor uses it.
106+
In Java the only allowed way to inject directives and to not break work of tools and compilers - is to use commented space, so that the preprocessor uses it.
110107
```Java
111108
//#local TESTVAR="TEST LOCAL VARIABLE"
112109
//#echo TESTVAR=/*$TESTVAR$*/
@@ -130,7 +127,7 @@ public static final void testproc()
130127
```
131128

132129
# Multi-sectioned documents
133-
In opposite a regular document, a Java document has as minimum two sections - prefix (where situated import and special information) and body. For access to such sections there are special preprocessing directives `//#prefix[-|+]`, `//#postfix[-|+]`. They allow to turn on or turn off output into prefix and postfix sections.
130+
In opposite a regular document, a Java document has as minimum two sections - prefix (where situated import and special information) and body. For access to such sections there are special preprocessing directives `//#prefix[-|+]`, `//#postfix[-|+]`. They allow turning on or off output into prefix and postfix sections.
134131
```Java
135132
//#prefix+
136133
import java.lang.*;
@@ -142,8 +139,8 @@ In opposite a regular document, a Java document has as minimum two sections - pr
142139
public static void main(String ... args){}
143140
}
144141
```
145-
# How to remove all coments from sources
146-
Sometime it is very useful to remove totally all comments from sources, such possiblitiy was included into JCP and can be activated through special flag or command line switcher. The Example of use for comment removing through CLI interface
142+
# How to remove all comments from sources
143+
Sometimes it is very useful to remove totally all comments from sources, such possibility included into JCP and can be activated with either a special flag or command line switcher. The example below shows how to remove all comments with CLI use:
147144
```
148145
java -jar ./jcp-7.0.4.jar --i:/sourceFolder --o:/resultFolder -ef:none --r
149146
```

0 commit comments

Comments
 (0)