Skip to content

Commit b61be18

Browse files
committed
Update the SIF AU data model to 1.3. Add ant build files. Add Eclipse project files.
1 parent e765b4c commit b61be18

40 files changed

+1657
-234
lines changed

Diff for: .project

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>OpenADK-java</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
</buildSpec>
9+
<natures>
10+
</natures>
11+
</projectDescription>

Diff for: README.md

+2-59
Original file line numberDiff line numberDiff line change
@@ -7,67 +7,10 @@ All files under the Apache license may be redistributed in binary and/or source
77

88
Overview
99
--------
10+
There are a couple of ways for building the OpenADK. Please refer to the 'Readme' files in each sub-directory for detailed build instructions.
1011

11-
The repository for the Open ADK Java project is at: https://github.com/open-adk/OpenADK-java
12+
If you are using Eclipse it is suggested to import the top level project (OpenADK-java) into Eclispe and then import all other sub-projects (adk-generator, adk-library & adk-examples) into Eclipse. After this initial import the projects may show up with errors. It is required to build the adk-generator and adk-library first and then 'refresh' the projects to remove these errors. Please refer to build instructions in appropriate Readme file.
1213

13-
If a Java JDK and Maven are installed, the following commands will install the built artifact in the local repository.
14-
15-
Note that the PROFILE may be one of AU, UK, or US.
16-
17-
* `mvn -P <PROFILE> install`
18-
19-
The ADK jar file (with data model built-in) is deposited in the target folder, or may be used in another maven project using the following dependency coordinates.
20-
21-
<dependency>
22-
<groupId>openadk</groupId>
23-
<artifactId>openadk-library</artifactId>
24-
<version>1.0.0-SNAPSHOT</version>
25-
<classifier>UK</classifier>
26-
</dependency>
27-
28-
The classifier is required in order to resolve the artifact that contins the desired data model.
29-
30-
Eclipse IDE setup
31-
-----------------
32-
33-
We've found that it is easier to use command line Maven with the Eclipse IDE. To prepare Eclipse for this kind of setup, the M2\_REPO classpath variable must be configured first using the following steps.
34-
35-
1. Open Eclipse IDE
36-
2. Open the Eclipse >> Preferences... dialog
37-
3. Navigate to Java >> Build Path >> Classpath Variables
38-
4. Click New...
39-
5. Enter `M2_REPO` for the Name
40-
6. Enter `<HOME>/.m2/repository` for the Path
41-
7. Click OK in the Edit Variable Entry dialog
42-
8. Clock OK in the Preferences dialog
43-
44-
Note: If you find that the M2\_REPO variable is already set and unmodifiable, then you likely have m2eclipse installed. Ensure that it is using the correct local repository in this case.
45-
46-
The Maven Eclipse plugin may now be used to create an Eclipse project. From the command line perform the following steps.
47-
48-
1. Change directory to OpenADK-java/adk-library
49-
2. Run `mvn -P <PROFILE> eclipse:eclipse`
50-
3. Import the adk-library project into Eclipse as an existing project
51-
52-
Ensure that the `target\generated-sources` exists in the project as a source folder.
53-
54-
Intellij IDEA setup
55-
-------------------
56-
57-
Ensure that the Maven plugins for IDEA are enabled before creating a module from the adk-library folder. To create a module in an existing project follow these steps.
58-
59-
1. Click the File >> New Module... menu option
60-
2. Select 'Import module from external model'
61-
3. Click Next
62-
4. Select OpenADK-java/adk-library as the root search directory
63-
5. Deselect Import Maven project automatically
64-
6. Click Next
65-
7. Select the desirect data model profile (AU, UK, or US)
66-
8. Click Next
67-
9. Select opendadk:openadk-library project to import
68-
10. Click Next
69-
70-
After the module is created in the project, the IDEA Maven Projects panel may be used to trigger Maven lifecycles (clean, compile, etc.).
7114

7215
Contributing
7316
------------

Diff for: adk-examples/.classpath

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="TinySIS/src/main/resources"/>
4+
<classpathentry kind="src" path="TinySIS/src/main/java"/>
5+
<classpathentry kind="src" path="SIFQuery/src/main/java"/>
6+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
7+
<classpathentry kind="lib" path="/OpenADK-java/lib/commons-jxpath/commons-jxpath-1.3.jar"/>
8+
<classpathentry kind="lib" path="/OpenADK-java/lib/log4j/log4j-1.2.16.jar"/>
9+
<classpathentry kind="lib" path="/adk-library/target/openADK.jar"/>
10+
<classpathentry kind="output" path="bin"/>
11+
</classpath>

Diff for: adk-examples/.project

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>adk-examples</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>

Diff for: adk-generator/.classpath

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src/main/java"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5+
<classpathentry kind="lib" path="/OpenADK-java/lib/xerces/xercesImpl.jar"/>
6+
<classpathentry kind="output" path="target/classes"/>
7+
</classpath>

Diff for: adk-generator/.project

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>adk-generator</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>

Diff for: adk-generator/Readme.txt

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
OpenADK - Data Model Class Library Generator (Java & .Net)
2+
==========================================================
3+
4+
This Readme.txt holds important instructions on how to build the data model classes for a particular
5+
locale (US, AU, UK). These classes will be required to build the final OpenADK libraries for Java and .Net.
6+
7+
-------------
8+
Pre-Requisite
9+
-------------
10+
11+
Java
12+
----
13+
You must have a Java JDK v1.6+ (not jre) installed on your machine and the JAVA_HOME variable is set and points to the JDK
14+
root directory. The data model class generator is a Java application and therefore requires Java. Also the Ant build tool
15+
(see next paragraph) is a Java based build tool.
16+
17+
Ant (https://ant.apache.org)
18+
-------------------------------------------
19+
The generation of the Java/.Net data model classes requires Ant. All versions from Ant 1.6 upwards should work.
20+
Please refer to the Ant documentation for installation instructions of Ant. All instructions within this file assume
21+
that Ant is installed and the the ANT_HOME environment variable is set and points to the Ant root directory.
22+
23+
You can run the required ant targets from either the command line or from within your desired IDE. The instructions
24+
below assume a command line.
25+
26+
------------------
27+
Build Instructions
28+
------------------
29+
Before you can build the data model classes you must ensure that you are in the directory adk-generator (this directory).
30+
You should also see a file called build.xml in this directory. If you don't then you are not in the correct directory.
31+
All instructions below assume that you type the given instruction in a command line tool and run it. You can also run the
32+
appropriate ant target from within your IDE, assuming your IDE supports ant or has an ant plugin.
33+
34+
------
35+
Step 1: Clean up previous builds
36+
-------
37+
c:\adk-generator>ant clean
38+
39+
-------
40+
Step 2: Build data model classes for Java or .Net for a particular locale (AU, US, UK)
41+
-------
42+
Generate Data Model Classes for Java for AU (Australia)
43+
c:\adk-generator>ant AU
44+
45+
The above will build the java classes for AU. If you wish to build them for .Net then type the following ant instruction
46+
on the command line:
47+
48+
c:\adk-generator>ant dotnet.au
49+
50+
etc.
51+
52+
The generated classes can be found in the directory adk-generator\target\adkgen\generated-sources\openadk\library
53+
If you change data model configuration files in the adk-generator\datadef directory you need to re-run the ant target
54+
from Step 2.
55+
56+
57+

Diff for: adk-generator/ant.properties

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#set value to java or cs (for csharp)
2+
generator.language=java

Diff for: adk-generator/build.xml

+57-31
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,54 @@
11
<?xml version="1.0" ?>
22
<project default="US" name="ADK Generator" basedir=".">
3+
4+
<!-- *************************** -->
5+
<!-- Load default property files -->
6+
<!-- *************************** -->
7+
<property file="${basedir}/ant.properties"/>
8+
9+
<property name="parent.dir" value="${basedir}/.." />
10+
<property name="generator.dir" value="${parent.dir}/adk-generator"/>
311
<property name="deploy.dir" value="../../OpenADK-csharp/src" />
4-
<property name="datadef.dir" value="${basedir}/datadef"/>
5-
<property name="mvn.target.dir" value="${basedir}/target"/>
6-
<property name="project.dir" value="${basedir}/target/adkgen" />
7-
<property name="mvn.classes.dir" value="${basedir}/target/classes"/>
8-
<property name="compile.classpath" value="${basedir}/lib/xercesImpl.jar;${basedir}/lib/xml-apis.jar;${mvn.classes.dir}" />
12+
<property name="datadef.dir" value="${generator.dir}/datadef"/>
13+
<property name="target.dir" value="${generator.dir}/target"/>
14+
<property name="project.dir" value="${generator.dir}/target/adkgen" />
15+
<property name="classes.dir" value="${generator.dir}/target/classes"/>
16+
<property name="lib.dir" value="${parent.dir}/lib"/>
17+
<property name="compile.classpath" value="${lib.dir}/xerces/xercesImpl.jar;${lib.dir}/xml-api/xml-apis.jar;${classes.dir}" />
918
<property name="srcgen.dir.name" value="generated-sources"/>
1019
<property name="srcgen.dir" value="${project.dir}/${srcgen.dir.name}"/>
1120

1221
<!--
1322
***** SHARED TARGETS *****
1423
-->
24+
<!-- print some varaibles -->
25+
<target name="00-env" description="Show Ant variables">
26+
<echo message="basedir: ${basedir}"/>
27+
<echo message="parent.dir: ${parent.dir}"/>
28+
<echo message="deploy.dir: ${deploy.dir}"/>
29+
<echo message="datadef.dir: ${datadef.dir}"/>
30+
<echo message="target.dir: ${target.dir}"/>
31+
<echo message="project.dir: ${project.dir}"/>
32+
<echo message="generator.dir: ${generator.dir}"/>
33+
<echo message="classes.dir: ${classes.dir}"/>
34+
<echo message="lib.dir: ${lib.dir}"/>
35+
<echo message="compile.classpath: ${compile.classpath}"/>
36+
<echo message="srcgen.dir.name: ${srcgen.dir.name}"/>
37+
<echo message="srcgen.dir: ${srcgen.dir}"/>
38+
<!--echo message="generator.language: ${generator.language}"/-->
39+
</target>
1540

1641
<!--
1742
This target is used to initialize properties as well as any other setup that needs to happen before the build process starts
1843
-->
1944
<target name="clean">
20-
<delete dir="target" failonerror="false"/>
45+
<delete dir="target/adkgen" failonerror="false"/>
2146
</target>
2247

2348
<target name="init" depends="clean">
2449
<!-- Create the output directory -->
2550
<mkdir dir="${srcgen.dir}" />
26-
<mkdir dir="${mvn.classes.dir}" />
51+
<mkdir dir="${classes.dir}" />
2752
</target>
2853

2954
<!--
@@ -35,7 +60,7 @@
3560
<echo>basedir: ${basedir}</echo>
3661
<echo>srcgen.dir: ${srcgen.dir}</echo>
3762
<!-- compile ADK generator -->
38-
<javac destdir="${mvn.classes.dir}" debug="true" classpath="${compile.classpath}">
63+
<javac destdir="${classes.dir}" debug="true" classpath="${compile.classpath}" includeantruntime="false">
3964
<src location="src/main/java" />
4065
</javac>
4166
<!-- For the compile to run we need the SIFDTD_xxx.txt files in the building folder ... but they reside in the adkgen folder -->
@@ -47,6 +72,7 @@
4772
<java classname="openadk.generator.Main" fork="true" dir="${project.dir}" classpath="${compile.classpath}">
4873
<arg value="${input.datadef}" />
4974
<arg value="o=${srcgen.dir.name}" />
75+
<!--arg value="l=${generator.language}" /-->
5076
</java>
5177
</target>
5278

@@ -125,7 +151,7 @@
125151
<echo>basedir: ${basedir}</echo>
126152
<echo>srcgen.dir: ${srcgen.dir}</echo>
127153
<!-- compile ADK generator -->
128-
<javac destdir="${mvn.classes.dir}" debug="true" classpath="${compile.classpath}">
154+
<javac destdir="${classes.dir}" debug="true" classpath="${compile.classpath}">
129155
<src location="src/main/java" />
130156
</javac>
131157
<!-- For the compile to run we need the SIFDTD_xxx.txt files in the building folder ... but they reside in the adkgen folder -->
@@ -153,9 +179,9 @@
153179
<property name="input.datadef" value="${datadef.dir}/core/sif11;${datadef.dir}/core/sif15r1;${datadef.dir}/core/sif20;${datadef.dir}/core/sif20r1;${datadef.dir}/core/sif21;${datadef.dir}/core/sif22;${datadef.dir}/core/sif23;${datadef.dir}/core/sif24;${datadef.dir}/core/sif25;${datadef.dir}/core/sif26" />
154180
<property name="input.locale" value="core"/>
155181
<antcall target="dotnet.build" />
156-
<mkdir dir="${mvn.target.dir}/dotnet/core/OpenADK" />
157-
<move file="${srcgen.dir}/openadk/library/Global" tofile="${mvn.target.dir}/dotnet/core/OpenADK/Global" />
158-
<move file="${srcgen.dir}/openadk/library/Infra" tofile="${mvn.target.dir}/dotnet/core/OpenADK/Infra" />
182+
<mkdir dir="${target.dir}/dotnet/core/OpenADK" />
183+
<move file="${srcgen.dir}/openadk/library/Global" tofile="${target.dir}/dotnet/core/OpenADK/Global" />
184+
<move file="${srcgen.dir}/openadk/library/Infra" tofile="${target.dir}/dotnet/core/OpenADK/Infra" />
159185
</target>
160186

161187
<target name="dotnet.au">
@@ -164,11 +190,11 @@
164190
<antcall target="dotnet.build" />
165191
<delete dir="${srcgen.dir}/openadk/library/Global" failonerror="false"/>
166192
<delete dir="${srcgen.dir}/openadk/library/Infra" failonerror="false"/>
167-
<mkdir dir="${mvn.target.dir}/dotnet/core/OpenADK/au" />
168-
<move file="${srcgen.dir}/openadk/library/SifDtd.cs" tofile="${mvn.target.dir}/dotnet/core/OpenADK/au/SifDtd.cs" />
169-
<move file="${srcgen.dir}/openadk/library/SdoLibraryType.cs" tofile="${mvn.target.dir}/dotnet/core/OpenADK/au/SdoLibraryType.cs" />
170-
<mkdir dir="${mvn.target.dir}/dotnet/au/sdo" />
171-
<move todir="${mvn.target.dir}/dotnet/au/sdo" includeEmptyDirs="false">
193+
<mkdir dir="${target.dir}/dotnet/core/OpenADK/au" />
194+
<move file="${srcgen.dir}/openadk/library/SifDtd.cs" tofile="${target.dir}/dotnet/core/OpenADK/au/SifDtd.cs" />
195+
<move file="${srcgen.dir}/openadk/library/SdoLibraryType.cs" tofile="${target.dir}/dotnet/core/OpenADK/au/SdoLibraryType.cs" />
196+
<mkdir dir="${target.dir}/dotnet/au/sdo" />
197+
<move todir="${target.dir}/dotnet/au/sdo" includeEmptyDirs="false">
172198
<fileset dir="${srcgen.dir}/openadk/library" casesensitive="no">
173199
<include name="**/*" />
174200
</fileset>
@@ -181,11 +207,11 @@
181207
<antcall target="dotnet.build" />
182208
<delete dir="${srcgen.dir}/openadk/library/Global" failonerror="false"/>
183209
<delete dir="${srcgen.dir}/openadk/library/Infra" failonerror="false"/>
184-
<mkdir dir="${mvn.target.dir}/dotnet/core/OpenADK/uk" />
185-
<move file="${srcgen.dir}/openadk/library/SifDtd.cs" tofile="${mvn.target.dir}/dotnet/core/OpenADK/uk/SifDtd.cs" />
186-
<move file="${srcgen.dir}/openadk/library/SdoLibraryType.cs" tofile="${mvn.target.dir}/dotnet/core/OpenADK/uk/SdoLibraryType.cs" />
187-
<mkdir dir="${mvn.target.dir}/dotnet/uk/sdo" />
188-
<move todir="${mvn.target.dir}/dotnet/uk/sdo" includeEmptyDirs="false">
210+
<mkdir dir="${target.dir}/dotnet/core/OpenADK/uk" />
211+
<move file="${srcgen.dir}/openadk/library/SifDtd.cs" tofile="${target.dir}/dotnet/core/OpenADK/uk/SifDtd.cs" />
212+
<move file="${srcgen.dir}/openadk/library/SdoLibraryType.cs" tofile="${target.dir}/dotnet/core/OpenADK/uk/SdoLibraryType.cs" />
213+
<mkdir dir="${target.dir}/dotnet/uk/sdo" />
214+
<move todir="${target.dir}/dotnet/uk/sdo" includeEmptyDirs="false">
189215
<fileset dir="${srcgen.dir}/openadk/library" casesensitive="no">
190216
<include name="**/*" />
191217
</fileset>
@@ -198,11 +224,11 @@
198224
<antcall target="dotnet.build" />
199225
<delete dir="${srcgen.dir}/openadk/library/Global" failonerror="false"/>
200226
<delete dir="${srcgen.dir}/openadk/library/Infra" failonerror="false"/>
201-
<mkdir dir="${mvn.target.dir}/dotnet/core/OpenADK/us" />
202-
<move file="${srcgen.dir}/openadk/library/SifDtd.cs" tofile="${mvn.target.dir}/dotnet/core/OpenADK/us/SifDtd.cs" />
203-
<move file="${srcgen.dir}/openadk/library/SdoLibraryType.cs" tofile="${mvn.target.dir}/dotnet/core/OpenADK/us/SdoLibraryType.cs" />
204-
<mkdir dir="${mvn.target.dir}/dotnet/us/sdo" />
205-
<move todir="${mvn.target.dir}/dotnet/us/sdo" includeEmptyDirs="false">
227+
<mkdir dir="${target.dir}/dotnet/core/OpenADK/us" />
228+
<move file="${srcgen.dir}/openadk/library/SifDtd.cs" tofile="${target.dir}/dotnet/core/OpenADK/us/SifDtd.cs" />
229+
<move file="${srcgen.dir}/openadk/library/SdoLibraryType.cs" tofile="${target.dir}/dotnet/core/OpenADK/us/SdoLibraryType.cs" />
230+
<mkdir dir="${target.dir}/dotnet/us/sdo" />
231+
<move todir="${target.dir}/dotnet/us/sdo" includeEmptyDirs="false">
206232
<fileset dir="${srcgen.dir}/openadk/library" casesensitive="no">
207233
<include name="**/*" />
208234
</fileset>
@@ -214,16 +240,16 @@
214240
<delete dir="${deploy.dir}/uk/sdo" failonerror="false"/>
215241
<delete dir="${deploy.dir}/us/sdo" failonerror="false"/>
216242
<copy todir="${deploy.dir}/au/sdo">
217-
<fileset dir="${mvn.target.dir}/dotnet/au/sdo" />
243+
<fileset dir="${target.dir}/dotnet/au/sdo" />
218244
</copy>
219245
<copy todir="${deploy.dir}/uk/sdo">
220-
<fileset dir="${mvn.target.dir}/dotnet/uk/sdo" />
246+
<fileset dir="${target.dir}/dotnet/uk/sdo" />
221247
</copy>
222248
<copy todir="${deploy.dir}/us/sdo">
223-
<fileset dir="${mvn.target.dir}/dotnet/us/sdo" />
249+
<fileset dir="${target.dir}/dotnet/us/sdo" />
224250
</copy>
225251
<copy todir="${deploy.dir}/core">
226-
<fileset dir="${mvn.target.dir}/dotnet/core" />
252+
<fileset dir="${target.dir}/dotnet/core" />
227253
</copy>
228254
</target>
229255

0 commit comments

Comments
 (0)