diff --git a/.gitignore b/.gitignore index 26724e152..8e93ea42c 100644 --- a/.gitignore +++ b/.gitignore @@ -79,3 +79,4 @@ rules.mk # Specific file names # (none yet, see ICU .gitignore for examples) +.DS_Store diff --git a/docs/unicodejsps/eclipse-jetty-run.png b/docs/unicodejsps/eclipse-jetty-run.png new file mode 100644 index 000000000..2193233c8 Binary files /dev/null and b/docs/unicodejsps/eclipse-jetty-run.png differ diff --git a/docs/unicodejsps/index.md b/docs/unicodejsps/index.md index 7433954ff..911100e7a 100644 --- a/docs/unicodejsps/index.md +++ b/docs/unicodejsps/index.md @@ -1,91 +1,82 @@ # Building UnicodeJsp -## Source +## Compiling +### Prerequisites +- Java +- Maven (download instructions [here](http://cldr.unicode.org/development/maven#TOC-Installing-Maven) +- GitHub account +- UnicodeJsp source downloaded - +### Maven Environment setup -## Jars +Setup your maven environment’s `.m2/settings.xml` as per +[CLDR instructions](http://cldr.unicode.org/development/maven#TOC-Getting-Started---GitHub-token). You don’t +need to actually need to download or build CLDR itself. -### Command Line +### Building from the command line + +Run `mvn package` in the UnicodeJsps directory to build the JSPs. -### Build icu4j jars +### Building from Eclipse -* download/checkout [icu4j](http://site.icu-project.org/download) -* from the command line: - **ant releaseCLDR** -* output in: four jars in {$workspace}/icu4j/release_cldr/ +UnicodeJsps can be imported into eclipse using the _Import->existing maven project_ menu option. +If you already have `UnicodeJsps` in eclipse, it might be better to remove it from eclipse before the import. -### Build [cldr](http://cldr.unicode.org).jar +## Running + +### Command Line -* from the command line: - **ant jar** -* output in: {$workspace}/cldr/tools/java/cldr.jar +```shell +mvn jetty:run +``` -(Note: These jars are slated to be available via Maven… keep an eye on -[ICU-21251](https://unicode-org.atlassian.net/browse/ICU-21251) ) +You can now connect to as suggested from the command line. +Use Control-C to stop the server. -### Eclipse +### Running from within Eclipse -Do the same as above, except: +This screenshot shows creating a `jetty:run` maven run configuration. -1. Right-click on build.xml in the respective directories - 1. {$workspace}/icu4j/build.xml - 2. {$workspace}/cldr/tools/java/build.xml -2. Select Run As... -3. Pick the target as above. +![Running jetty:run from eclipse](eclipse-jetty-run.png) -### Copy +### Debugging from within eclipse -Copy the following into {$workspace}/UnicodeJsps/WebContent/WEB-INF/lib/ +Jetty provides instructions [here](https://www.eclipse.org/jetty/documentation/jetty-9/index.html#debugging-with-eclipse) for debugging +within eclipse. It is unknown whether this has been attempted with the UnicodeJsps. -* *failureaccess-sources.jar* -* *failureaccess.jar* -* *failureaccess.txt* -* cldr.jar -* gson-sources.jar -* gson-version.txt -* gson.jar -* guava-sources.jar -* guava-version.txt -* guava.jar -* icu4j-src.jar -* icu4j-version.txt -* icu4j.jar -* utilities-src.jar -* utilities.jar -* xercesImpl.jar +## Upgrading the UnicodeJsps -## Text Files +### Text Files -Into {$workspace}/unicode-jsps/src/org/unicode/jsp +Into `{$workspace}/UnicodeJsps/src/main/resources/org/unicode/jsp` Copy in newest versions of: -{$workspace}/unicodetools/data/security/\ +`{$workspace}/unicodetools/data/security/\` * confusables.txt * IdentifierStatus.txt * IdentifierType.txt -{$workspace}/unicodetools/data/ucd/\-Update/ +`{$workspace}/unicodetools/data/ucd/\-Update/` * NameAliases.txt * NamesList.txt * ScriptExtensions.txt * StandardizedVariants.txt -{$workspace}/unicodetools/data/idna/\ +`{$workspace}/unicodetools/data/idna/\` * IdnaMappingTable.txt -{$workspace}/unicodetools/data/emoji/\ +`{$workspace}/unicodetools/data/emoji/\` * emoji-sequences.txt * emoji-zwj-sequences.txt * *\* :construction: **TODO** -Run \[cldr\] GenerateSubtagNames to generate results on the console; paste the -results into subtagNames.txt +Run \[cldr\] `GenerateSubtagNames` to generate results on the console; paste the +results into `subtagNames.txt` Other files: @@ -107,15 +98,13 @@ Files to investigate * temp.html * test.htm -**:construction: **TODO**: Change CopyPropsToUnicodeJsp to copy all the necessary files!** - ## Adding/Updating New Properties -Go to XPropertyFactory.java to add new properties other than the ones in /props/ +Go to `XPropertyFactory.java` to add new properties other than the ones in /props/ ### Adding "/Prop/" Properties -#### UnicodeJsps/org/unicode/jsp/data +#### UnicodeJsps/src/main/resources/org/unicode/jsp/data Update the following files by copying from org/unicode/props @@ -127,7 +116,7 @@ Update the following files by copying from unicodetools/data/ucd/XX.0.0-Update * PropertyAliases.txt * PropertyValueAliases.txt -#### UnicodeJsps/org/unicode/jsp/props/ +#### UnicodeJsps/src/main/resources/org/unicode/jsp/props/ Run ListProps. It will copy .bin files into {generated}bin/XX.0.0.0. Examples: @@ -137,7 +126,7 @@ Run ListProps. It will copy .bin files into {generated}bin/XX.0.0.0. Examples: * Bidi_Class.bin * ... -Copy those into /UnicodeJsps/src/org/unicode/jsp/props using +Copy those into /UnicodeJsps/src/main/resources/org/unicode/jsp/props using CopyPropsToUnicodeJsp ### Using Beta Properties @@ -146,12 +135,12 @@ Set CachedProps.IS_BETA to true. Build & Test -1. Run {$workspace}/unicode-jsps-tst/src/org/unicode/jsptest/TestAll.java. +1. Run `mvn test` :construction: **TODO**: These need a lot of work; they mostly print out a lot of gorp that you need to scan over. -Run the server. +Run the server (see above) Look at , and make sure that there aren't any Z-Other props at the bottom (you'll need to update via Adding @@ -159,10 +148,6 @@ New Properties if there are). (:construction: **TODO**: explain how to do a Docker-based build here.) -## Running Locally - -See - ## Commit/PR 1. Commit the code to your own branch, create a PR on GitHub diff --git a/unicodetools/org/unicode/propstest/CopyPropsToUnicodeJsp.java b/unicodetools/org/unicode/propstest/CopyPropsToUnicodeJsp.java index 59382bf0c..0b6cdf7d7 100644 --- a/unicodetools/org/unicode/propstest/CopyPropsToUnicodeJsp.java +++ b/unicodetools/org/unicode/propstest/CopyPropsToUnicodeJsp.java @@ -23,7 +23,7 @@ public static void main(String[] args) throws IOException { IndexUnicodeProperties latest = IndexUnicodeProperties.make(); String fromDir = Settings.Output.BIN_DIR + latest.getUcdVersion() + "/"; - String toDir = Settings.UnicodeTools.UNICODEJSPS_DIR + "src/org/unicode/jsp/props/"; + String toDir = Settings.UnicodeTools.UNICODEJSPS_DIR + "src/main/resources/org/unicode/jsp/props/"; //overwrite existing file, if exists CopyOption[] options = new CopyOption[] {StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES}; Set kExceptions = ImmutableSet.of("kAccountingNumeric.bin", "kOtherNumeric.bin", "kPrimaryNumeric.bin", "kSimplifiedVariant.bin", "kTraditionalVariant.bin");