Skip to content

Instantly share code, notes, and snippets.

@redfish4ktc
Created June 18, 2011 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redfish4ktc/1032973 to your computer and use it in GitHub Desktop.
Save redfish4ktc/1032973 to your computer and use it in GitHub Desktop.
Configuration Maven pour lancer la génération du jar contenant les écrans et transactions Scort
<!--
#####################################
build developpe grace a l'article suivant :
http://www.scort.com/eng/index.php/fr/blog/viewpost/128
#####################################
-->
<project default="build-es-se-ft-project">
<!-- properties es.install.dir, ES_project_path and ES_resource_path must be set before.
es.install.dir=<ENTERPRISE_STUDIO_INSTALL_PATH>
ES_project_path=<PATH_TO_THE_ENTERPRISE_STUDIO_PROJECT_DIRECTORY>
ES_resource_path=<PATH_TO_THE_ENTERPRISE_STUDIO_RESOURCE_REPOSITORY.CFG_FILE>
ex:
<property name="es.install.dir" value="D:\SCORT\ES 5.1"/>
<property name="ES_project_path" value="${basedir}/ES-PROJECT/Aos3270ESProject" />
<property name="ES_resource_path" value="${ES_project_path}/Project.es_prj/Res.es_res/TN3270VSDemo.es3270/repository.cfg"/>
-->
<property name="es.install.template.dir" location="${basedir}/../scort_es_installation_template"/>
<property name="es.install.dir" location="${basedir}/target/process-resources/scort_es_installation"/>
<property name="ES_project_path" value="${basedir}" />
<target name="init-generated-directories">
<property name="ES_generated_dir_path" value="${ES_project_path}/Generated.es_gen" />
<delete dir="${ES_generated_dir_path}" />
<mkdir dir="${ES_generated_dir_path}" />
<mkdir dir="${ES_generated_dir_path}/DataMapper.es_gdm" />
<mkdir dir="${ES_generated_dir_path}/Java.es_gjava" />
<mkdir dir="${ES_generated_dir_path}/Java.es_gjava/Sources.es_gjsrc" />
<mkdir dir="${ES_generated_dir_path}/Java.es_gjava/Production.es_gjprd" />
<mkdir dir="${ES_generated_dir_path}/Java.es_gjava/Classes.es_gjcls" />
<mkdir dir="${ES_generated_dir_path}/WebApps.es_gweb" />
<mkdir dir="${ES_generated_dir_path}/Documentation.es_doc" />
</target>
<target name="prepare-installation" >
<delete dir="${es.install.dir}" />
<mkdir dir="${es.install.dir}" />
<copy todir="${es.install.dir}" >
<fileset dir="${es.install.template.dir}" />
</copy>
<property name="install.properties.tmp.file" location="${es.install.dir}/ini/cp/install.properties.tmp" />
<copy tofile="${install.properties.tmp.file}" file="${es.install.template.dir}/ini/cp/install.properties"
filtering="true" overwrite="true" verbose="true">
<filterset>
<filter token="JDK_HOME" value="${java.home}/.."/>
<filter token="INSTALL_DIR" value="${es.install.dir}"/>
</filterset>
</copy>
<!-- pour traiter le cas des chemins sous windows
ceci ne peut pas etre fait en meme temps que la copie car dans le cas ou on utilise un filterset et un filterchain
en meme temps, le filterchain est traite en 1er. Dans notre cas, on veut appliquer le filterchain apres.
-->
<copy tofile="${es.install.dir}/ini/cp/install.properties" file="${install.properties.tmp.file}"
overwrite="true" verbose="true">
<filterchain>
<replacestring from="\" to="\\"/>
</filterchain>
</copy>
<delete file="${install.properties.tmp.file}" />
</target>
<target name="build-es-se-ft-project" depends="prepare-installation, init-generated-directories">
<property name="ES_resource_path" location="${ES_project_path}/Project.es_prj/Res.es_res/scort-a16.es3270/repository.cfg"/>
<property name="esclasspath" location="${es.install.dir}/runtime/scort/es.jar"/>
<!--
Cette classe est une implementation specifique (qu'on peut trouver dans ce projet), package sous forme
de jar qui est stocke dans le template d'installation avec les autres jars necessaire a la generation
(lib/runtime/scort/headless-builder.jar)
-->
<property name="scort.project.builder.class" value="com.scort.es.builder.HeadlessBuilderTerminal"/>
<java fork="true" classname="com.scort.es.launcher.Launcher" classpath="${esclasspath}" failonerror="true">
<!--
Permet de valider que la generation fonctionnera meme dans un environnement qui ne supporte pas de peripherique
graphique. Ce n'est pas le cas avec la classe sandard de generation fournie par scort
-->
<jvmarg line="-Djava.awt.headless=true" />
<arg line="-PATH '${es.install.dir}' -TARGET ${scort.project.builder.class} -INFO -RESOURCE '${ES_resource_path}'"/>
</java>
</target>
</project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.ktc.scort.generation</groupId>
<artifactId>scort-project</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<ant antfile="build.xml" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classesDirectory>Generated.es_gen/Java.es_gjava/Classes.es_gjcls/scort-a16.es3270</classesDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment