Skip to content

Commit f63d1ad

Browse files
committed
#1 added --z (compareDestination) to not override file if the save content
1 parent 971b6d4 commit f63d1ad

20 files changed

+493
-189
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target/
2+
/nbproject/

.projectKnowledge/JCPreprocessor.mmd

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Mind Map generated by NB MindMap plugin
2+
> __version__=`1.0`
3+
---
4+
5+
# Java Comment<br/>preprocessor
6+
- LINK
7+
<pre>https://github.com/raydac/java-comment-preprocessor</pre>
8+
9+
## Issues
10+
> fillColor=`#FF9999`
11+
12+
- LINK
13+
<pre>https://github.com/raydac/java-comment-preprocessor/issues</pre>
14+
15+
## Backlog
16+
> fillColor=`#99FF99`
17+
18+
19+
## Changelog
20+
> leftSide=`true`
21+
22+
- FILE
23+
<pre>changelog.txt</pre>

changelog.txt

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
6.0.1
2+
- added --z option ('compareDestination' in MAVEN and ANT) to check content of existing result file and to not replace it if content equals (issue #1), by default turned off because makes some overhead
3+
- fixed --c argument usage in CLI, now by default the preprocessor started in CLI doesn't clear its output folder, use --c to turn it on
4+
- improved tests
5+
- minor bug-fixing
6+
7+
6.0.0
8+
- bugfixing and log improvement
9+
- RENAMED DIRECTIVE! //#assert renamed to appropriate name //#echo
10+
- RENAMED FUNCTIONS! renamed XML functions to more appropriate and short names
11+
- xml_getRoot to xml_root
12+
- xml_elementAt to xml_get
13+
- xml_elementsNumber to xml_size
14+
- xml_getAttribute to xml_attr
15+
- xml_getElementName to xml_name
16+
- xml_getElementsForName to xml_list
17+
- xml_getElementText to xml_text
18+
- fixed //#exit and //#exitif behavior to prevent total exit and return level up in include stack
19+
- added //#abort directive to provide possibility to stop preprocessing immediately without errors
20+
- added function 'STR evalfile(STR)' for local preprocessing of a file body and return it as a string
21+
- added predefined variables 'line','filename','filefolder' and 'file' which allow to get name and path parameters for the current preprocessing file path
22+
- added predefined variables 'time','date' and 'timestamp' which work similar C++ predefined macroses
23+
- added function 'STR str2java(STR,BOOL)' to escape and split string to be presented as java sources
24+
- added functions 'STR str2js(STR)', 'STR str2json(STR)','STR str2xml(STR)' and 'STR str2csv(STR)'
25+
- added functions 'STR xml_xlist(STR,STR)' and 'STR xml_xelement(STR,STR)' which allow to use xpath to get element lists an elements
26+
- apache common-io and common-lang libraries have been packed into the jar and hidden
27+
- added the short variant '//#ifdef BOOL' for '//#ifdefined BOOL'
28+
- added '//#ifndef BOOL' to check that a variable is undefined
29+
- added '//#definel NAME' and '//#define NAME' to define local and global variables, they can use not only the default TRUE value for defined variables, but also result of expression (example: //#define ten 2*5)
30+
- added '//#undef NAME' to remove a variable definition from context
31+
- added '//#error EXPR' and '//#warning EXPR' directives to throw exception and log warnings
32+
- added support of custom line separator through the 'jcp.line.separator' system property
33+
- added '//#noautoflush' to prevent auto saving text buffers after file preprocessing
34+
35+
5.3.4
36+
- added support of test source folder preprocessing for maven projects
37+
- added the "clear" maven goal to clear created preprocessing folders or any defined folders and files
38+
- by default the maven plugin trying to keep numeration of lines in preprocessed files (the 'keepLines' is true by default)
39+
40+
5.3.3
41+
- fixed the bug in the comment removing (multiple stars before closing slash)
42+
- fixed the exception if there is not any organization tag in a project pom.xml
43+
- added support for '-' and '--' prefixes in CLI arguments
44+
- improved CLI argument error messaging
45+
- the license has been changed to Apache 2.0
46+
47+
5.3.2
48+
- very minor refactoring.
49+
- fixed issue (ID 5) "Removing strings contain only spaces"
50+
- the first version published in the maven central
51+
52+
5.3.1
53+
- very minor bug-fixing, added the main-class attribute in the preprocessor JAR Manifest
54+
55+
5.3
56+
- Added feature to keep non-executing lines as commented ones (/k command line key), all non-executing lines will be saved in the output as commented ones
57+
58+
5.2
59+
- Fixed issue (ID 3). The default charset was used to read text files.
60+
61+
5.1
62+
- Fixed issue (ID 1). Inaccessible functionality both "load a file with global variables" and "define global variable" through a command line call.
63+
64+
5.0
65+
- The initial published version of totally reworked preprocessor

pom.xml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1616
<timestamp>${maven.build.timestamp}</timestamp>
1717
<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
18+
<maven.home>${user.home}/Programs/apache-maven-3.3.9</maven.home>
1819
</properties>
1920

2021
<issueManagement>
@@ -26,12 +27,11 @@
2627
<developer>
2728
<id>raydac</id>
2829
<name>Igor Maznitsa</name>
29-
<email>igor.maznitsa@igormaznitsa.com</email>
30+
<email>rrg4400@gmail.com</email>
3031
<url>http://www.igormaznitsa.com</url>
31-
<timezone>+3</timezone>
32+
<timezone>+2</timezone>
3233
<roles>
3334
<role>Author</role>
34-
<role>Developer</role>
3535
</roles>
3636
</developer>
3737
</developers>
@@ -208,7 +208,7 @@
208208
<dependency>
209209
<groupId>org.apache.commons</groupId>
210210
<artifactId>commons-lang3</artifactId>
211-
<version>3.3.2</version>
211+
<version>3.4</version>
212212
<scope>compile</scope>
213213
</dependency>
214214
</dependencies>
@@ -242,7 +242,7 @@
242242
<plugin>
243243
<groupId>org.apache.maven.plugins</groupId>
244244
<artifactId>maven-shade-plugin</artifactId>
245-
<version>2.3</version>
245+
<version>2.4.2</version>
246246
<executions>
247247
<execution>
248248
<phase>package</phase>
@@ -270,7 +270,7 @@
270270
<plugin>
271271
<groupId>org.apache.maven.plugins</groupId>
272272
<artifactId>maven-jar-plugin</artifactId>
273-
<version>2.5</version>
273+
<version>2.6</version>
274274
<configuration>
275275
<archive>
276276
<manifest>
@@ -298,7 +298,7 @@
298298
<plugin>
299299
<groupId>org.apache.maven.plugins</groupId>
300300
<artifactId>maven-compiler-plugin</artifactId>
301-
<version>3.1</version>
301+
<version>3.3</version>
302302
<configuration>
303303
<compilerArgument>-Xlint:all</compilerArgument>
304304
<verbose>true</verbose>
@@ -314,7 +314,7 @@
314314

315315
<plugin>
316316
<artifactId>maven-failsafe-plugin</artifactId>
317-
<version>2.12.4</version>
317+
<version>2.19</version>
318318
<executions>
319319
<execution>
320320
<goals>
@@ -324,12 +324,12 @@
324324
</execution>
325325
</executions>
326326
<configuration>
327+
<encoding>UTF-8</encoding>
327328
<systemProperties>
328329
<property>
329330
<!-- Unfortunately there is not any legal way to get the maven home -->
330331
<name>maven.home</name>
331-
<!--<value>C:/Utils/maven</value>-->
332-
<value>${user.home}/Programs/apache-maven-3.1.1</value>
332+
<value>${maven.home}</value>
333333
</property>
334334
<property>
335335
<name>plugin.jar</name>
@@ -346,7 +346,7 @@
346346
<plugin>
347347
<groupId>org.apache.maven.plugins</groupId>
348348
<artifactId>maven-source-plugin</artifactId>
349-
<version>2.3</version>
349+
<version>2.4</version>
350350
<executions>
351351
<execution>
352352
<id>generate-sources</id>
@@ -361,7 +361,7 @@
361361
<plugin>
362362
<groupId>org.codehaus.mojo</groupId>
363363
<artifactId>animal-sniffer-maven-plugin</artifactId>
364-
<version>1.12</version>
364+
<version>1.14</version>
365365
<configuration>
366366
<signature>
367367
<groupId>org.codehaus.mojo.signature</groupId>
@@ -383,7 +383,7 @@
383383
<plugin>
384384
<groupId>org.codehaus.mojo</groupId>
385385
<artifactId>exec-maven-plugin</artifactId>
386-
<version>1.3.2</version>
386+
<version>1.4.0</version>
387387
<executions>
388388
<execution>
389389
<goals>

src/main/java/com/igormaznitsa/jcp/InfoHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static String getCopyright() {
3939
}
4040

4141
public static String getSite() {
42-
return "Project page: http://java-comment-preprocessor.googlecode.com/";
42+
return "Project page: https://github.com/raydac/java-comment-preprocessor";
4343
}
4444

4545
public static String getProductName() {
@@ -53,7 +53,7 @@ public static List<String> makeTextForHelpInfo() {
5353
result.add("");
5454

5555
result.add("Command line directives\n------------");
56-
result.add("\n(!)Historically all directives are prefixed by '/' but since 5.3.3 both '-' and '--' prefixes allowed\n");
56+
result.add("\n(!)Historically all directives are prefixed by '/' but since 5.3.3 both '-' and '--' prefixes are allowed\n");
5757
result.add(makeColumns("@cfg_file", "file contains global definition list", 14));
5858
for (final CommandLineHandler handler : JCPreprocessor.getCommandLineHandlers()) {
5959
result.add(makeCommandLineKeyReference(handler));

0 commit comments

Comments
 (0)