You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-20Lines changed: 17 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,27 +33,24 @@ __7.0.3 (13-sep-2020)__
33
33
34
34
# Introduction
35
35
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.
40
37
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
42
39
43
-
# Documap
40
+
# Mind map with all options
44
41
45
-

42
+

46
43
47
44
# How to use
48
45
49
46
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)
55
52
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).
57
54
```
58
55
<build>
59
56
<plugins>
@@ -78,11 +75,11 @@ The Preprocessor is published in the Maven Central (it is not published in Gradl
78
75
```
79
76
80
77
# 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:
82
79
```
83
80
java -jar jcp-7.0.4.jar --i:./test --o:./result
84
81
```
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)
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.
110
107
```Java
111
108
//#local TESTVAR="TEST LOCAL VARIABLE"
112
109
//#echo TESTVAR=/*$TESTVAR$*/
@@ -130,7 +127,7 @@ public static final void testproc()
130
127
```
131
128
132
129
# 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.
134
131
```Java
135
132
//#prefix+
136
133
importjava.lang.*;
@@ -142,8 +139,8 @@ In opposite a regular document, a Java document has as minimum two sections - pr
142
139
publicstaticvoidmain(String ... args){}
143
140
}
144
141
```
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:
0 commit comments