{"id":46064437,"url":"https://github.com/abego/jpp","last_synced_at":"2026-03-01T12:05:40.313Z","repository":{"id":3214553,"uuid":"4249153","full_name":"abego/jpp","owner":"abego","description":"jpp - A Simple Java Preprocessor for Ant","archived":false,"fork":false,"pushed_at":"2018-06-01T22:51:30.000Z","size":18,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-14T00:35:14.797Z","etag":null,"topics":["ant","java","java-preprocessor","jpp","preprocessor"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abego.png","metadata":{"files":{"readme":"README.html","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-05-07T12:08:02.000Z","updated_at":"2022-11-24T15:08:37.000Z","dependencies_parsed_at":"2022-08-27T03:23:54.382Z","dependency_job_id":null,"html_url":"https://github.com/abego/jpp","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"purl":"pkg:github/abego/jpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abego%2Fjpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abego%2Fjpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abego%2Fjpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abego%2Fjpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abego","download_url":"https://codeload.github.com/abego/jpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abego%2Fjpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29969243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T11:43:06.159Z","status":"ssl_error","status_checked_at":"2026-03-01T11:43:03.887Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ant","java","java-preprocessor","jpp","preprocessor"],"created_at":"2026-03-01T12:05:39.781Z","updated_at":"2026-03-01T12:05:40.307Z","avatar_url":"https://github.com/abego.png","language":"Java","readme":"\u003c!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"\u003e\n\u003chtml xmlns=\"http://www.w3.org/1999/xhtml\"\u003e\n\u003chead\u003e\n  \u003cmeta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /\u003e\n  \u003cmeta http-equiv=\"Content-Style-Type\" content=\"text/css\" /\u003e\n  \u003cmeta name=\"generator\" content=\"pandoc\" /\u003e\n  \u003ctitle\u003ejpp - A Simple Java Preprocessor for Ant\u003c/title\u003e\n  \u003cstyle type=\"text/css\"\u003ecode{white-space: pre;}\u003c/style\u003e\n  \u003cstyle type=\"text/css\"\u003e\nhtml {color: #333333; line-height: 1.5; font-family: Helvetica, arial, sans-serif;} pre {background-color: #f8f8f8;border: 1px solid #ddd;}\n  \u003c/style\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003ch1 id=\"jpp---a-simple-java-preprocessor-for-ant\"\u003ejpp - A Simple Java Preprocessor for Ant\u003c/h1\u003e\n\u003ch2 id=\"about-jpp\"\u003eAbout jpp\u003c/h2\u003e\n\u003cp\u003ejpp is an Ant task for preprocessing text files, especially Java source files.\u003c/p\u003e\n\u003cp\u003eIts main purpose is to allow \u0026#8220;conditional compilation\u0026#8221;. Other features commonly provided by text preprocessors, like inclusion of files or macro expansion, are not supported.\u003c/p\u003e\n\u003cp\u003eAnt provides the jpp task with properties that control the preprocessing of the files. Using conditional directives parts of the text file can be excluded in the resulting file.\u003c/p\u003e\n\u003ch2 id=\"syntax\"\u003eSyntax\u003c/h2\u003e\n\u003cpre\u003e\u003ccode\u003e#if [!]propertyName [# ... optional inline comment ...]\n    ...text 1...\n[#else\n    ...text 2...]\n#endif\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e\u003cem\u003e(\u0026#8217;[ \u0026#8230; ]\u0026#8217; encloses optional parts).\u003c/em\u003e\u003c/p\u003e\n\u003ch2 id=\"preprocessing\"\u003ePreprocessing\u003c/h2\u003e\n\u003cp\u003ejpp analyses a file\u0026#8217;s text line-by-line and writes the result to the destination file.\u003c/p\u003e\n\u003cp\u003eHere the details of the preprocessing:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eWhen the \u003ccode\u003e#if\u003c/code\u003e condition is true the lines following the \u003ccode\u003e#if\u003c/code\u003e (i.e. \u0026#8220;\u003ccode\u003e...text 1...\u003c/code\u003e\u0026#8221;) are copied to the destination file, otherwise the lines following the \u003ccode\u003e#else\u003c/code\u003e (i.e. \u0026#8220;\u003ccode\u003e...text 2...\u003c/code\u003e\u0026#8221;) are copied.\u003c/li\u003e\n\u003cli\u003eAll lines containing a jpp directive (\u003ccode\u003e#if\u003c/code\u003e, \u003ccode\u003e#else\u003c/code\u003e, \u003ccode\u003e#endif\u003c/code\u003e) are removed.\u003c/li\u003e\n\u003cli\u003eAll lines outside an \u003ccode\u003e#if...#endif\u003c/code\u003e block are copied to the destination file.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003e#if\u003c/code\u003e \u0026#8230; \u003ccode\u003e#endif\u003c/code\u003e blocks can be nested, i.e.\u0026#160;they can appear in the \u0026#8220;if\u0026#8221; and \u0026#8220;else\u0026#8221; areas of an outer \u003ccode\u003e#if\u003c/code\u003e \u0026#8230; \u003ccode\u003e#endif\u003c/code\u003e block.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eAn \u003ccode\u003e#if\u003c/code\u003e condition is true if either\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003ea single name is specified (e.g. \u0026#8220;\u003ccode\u003e#if FOO\u003c/code\u003e\u0026#8221;) and the property with that name holds the value \u003ccode\u003etrue\u003c/code\u003e, or\u003c/li\u003e\n\u003cli\u003ea negate operator \u003ccode\u003e!\u003c/code\u003e and a name is given (e.g. \u0026#8220;\u003ccode\u003e#if !FOO\u003c/code\u003e\u0026#8221;) and no property with that name is defined or the property does not hold the value \u003ccode\u003etrue\u003c/code\u003e.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"using-jpp-directives-in-java-source-files\"\u003eUsing jpp directives in Java source files\u003c/h2\u003e\n\u003cp\u003eWhen using jpp directives in Java source files the directives must be included in Java comments to avoid compile errors.\u003c/p\u003e\n\u003cp\u003eYou may either use single line comments, e.g.\u0026#160;as in:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e//#if FOO\n    ... regular Java text\n//#endif\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eor block comments like:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e/*#if FOO\n    ... text in comment ...\n#endif*/\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eWhen using the block comment approach the text inside the directive block will not be compiled in the original file. However when the condition is satisfied the resulting file will contain the text without the wrapping comment, i.e.\u0026#160;it will be compiled.\u003c/p\u003e\n\u003ch2 id=\"examples\"\u003eExamples\u003c/h2\u003e\n\u003cpre\u003e\u003ccode\u003e/*#if FOO\n    ... text in comment ...\n#else*/\n    ... text outside comment ...\n//#endif\n\n//#if !FOO\n... text to be excluded when FOO is true ...\n//#endif\u003c/code\u003e\u003c/pre\u003e\n\u003ch2 id=\"ant-integration\"\u003eAnt integration\u003c/h2\u003e\n\u003cpre\u003e\u003ccode\u003e\u0026lt;project name=\u0026quot;YourProjectName\u0026quot; ... \u0026gt;\n\n    \u0026lt;!-- Register the jpp ant task --\u0026gt;\n    \u0026lt;taskdef resource=\u0026quot;jpp.xml\u0026quot; classpath=\u0026quot;lib/jpp/1.0.3/jpp-1.0.3.jar\u0026quot; /\u0026gt;\n    ...\n    \n    \u0026lt;!-- defined properties to control the preprocessing --\u0026gt;\n    \u0026lt;property name=\u0026quot;NO_FOO\u0026quot; value=\u0026quot;true\u0026quot; /\u0026gt;\n    \u0026lt;property name=\u0026quot;WITH_BLA\u0026quot; value=\u0026quot;true\u0026quot; /\u0026gt;\n    ...\n    \n    \u0026lt;!-- call the jpp tool inside a target --\u0026gt;\n    \u0026lt;target name=\u0026quot;preprocess\u0026quot;\u0026gt;\n        \u0026lt;jpp destdir=\u0026quot;src-gen\u0026quot; readonly=\u0026quot;true\u0026quot; verbose=\u0026quot;false\u0026quot;\u0026gt;\n            \u0026lt;fileset dir=\u0026quot;src/\u0026quot; includes=\u0026quot;**/*.java\u0026quot; excludesfile=\u0026quot;config/excludes.txt\u0026quot; /\u0026gt;\n            \u0026lt;fileset dir=\u0026quot;src/\u0026quot; includesfile=\u0026quot;config/includes.txt\u0026quot; /\u0026gt;\n        \u0026lt;/jpp\u0026gt;\n    \u0026lt;/target\u0026gt;\n    ...\n        \n\u0026lt;/project\u0026gt;\u003c/code\u003e\u003c/pre\u003e\n\u003ch2 id=\"license\"\u003eLicense\u003c/h2\u003e\n\u003cp\u003ejpp is distributed under a BSD license of \u003ca href=\"http://www.abego-software.de/index.html\"\u003eabego Software\u003c/a\u003e.\u003c/p\u003e\n\u003ch2 id=\"links\"\u003eLinks\u003c/h2\u003e\n\u003cp\u003eSources: \u003ca href=\"https://github.com/abego/jpp\"\u003ehttps://github.com/abego/jpp\u003c/a\u003e\u003c/p\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabego%2Fjpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabego%2Fjpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabego%2Fjpp/lists"}