Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.
Mayan Jean edited this page Sep 27, 2019 · 31 revisions

Welcome to the TypeCobolBuild wiki!

TypeCobolBuild is the TypeCobol build currently based on RTC [(Rational Team Concert)] (https://jazz.net/downloads/rational-team-concert/releases/5.0.2). The project aims to provide a tool for compiling projects using the parser/generator TypeCobol.

The TypeCobolBuild project consists of:

  • JTCB the main java project, it uses the RTC-SDK (Rational Team Concert) to access files located on RTC Streams.
  • TCB a DLL (Dynamic Link Library) written using C++/CLI programming language which implements the interoperability between the Java SDK and the .Net Framewok.
  • TypeCobolBuilder the Build Engine implementation directly in relation with TypeCobol infrastructure and written using C# programming language.

Getting Started

Download

The TypeCobolBuild project is available as a zip download or via git:

git clone https://github.com/TypeCobolTeam/TypeCobolBuild.git

Prerequisites

You will also need the following prerequisites:

RTC Plain Java Librairies

  • Download the RTC SDK RTC-Client-plainJavaLib-5.0.2.
  • Unzip the content of the RTC-Client-plainJavaLib-5.0.2.zip file somewhere, and copy all files of the resulting directory RTC-Client-plainJavaLib-5.0.2 in your local clone repository exactly in the directory TypeCobolBuild/JTCB/rtc_libs. The result should looks like the following screenshot.

Rational Team Concert SDK 5.0.2

JDK 1.7

  • Download and install the Java JDK 1.7 or later.
  • Set your environment variable JAVA_HOME to the JDK install directory (for example: set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_80).

Maven

  • The project JTCB is buildable using Maven. We use Maven (version 3.3.9)
  • Add in in your Path environment variable the Maven binary directory (example: C:\Program Files\apache-maven-3.3.9\bin).

Gradle

  • The project JTCB is buildable using Gradle. We use Gradle (version 2.14)
  • Add in in your Path environment variable the Gradle binary directory (example: C:\Program Files\gradle-2.14\bin).

Building JTCB

JTCB can be build using Maven or Gradle.

Building with Maven

The main prerequisite with building using Maven is to store RTC Plain Java Libraries in the Maven local repository on your machine. So the first time that you build the project you must execute the following command in the JTCB directory.

* TypeCobolBuild\JTCB\RepoRTC.bat

You use the following Maven commands to respectively: compile, produce a full jar package and produce a full jar package without running tests.

  • mvn compile
  • mvn package
  • mvn package -DskipTests

Building with Gradle

With Gradle there is no prerequisite, it is possible to simply specify a directory of custom RTC jar libraries to includes in the project. So in th JTCB directory you use the following Gradle commands to respectively: compile, compile without tests, produce a full jar package.

  • gradle build
  • gradle build -x test
  • gradle dist

Building TCB and TypeCobolBuilder

Both TCB and TypeCobolBuilder are build into one VisualStudio 2015 Solution TypeCobolBuilder.sln located in the directory TypeCobolBuild\TypeCobolBuilder of your local clone directory. The solution target various configurations(Release, Debug), various platforms(x86/Win32 and x64) and various Tools (Maven, Gradle). So it is recommanded to build all configurations for all Platforms, as JTCB will match the best Platform for the JDK installed on your machine and the build tool of your choice.

TypeCobol prerequisites and dependencies

For building the TypeCobolBuilder solution, you will need to pick up from your TypeCobol distribution two assemblies: TypeCobol.exe and TypeCobol.Grammar.dll, both must be put in the directory TypeCobolBuild/TypeCobolBuilder/packages/TypeCobol of your local clone repository, like shown in the screenshot below.

Building a distribution

For building a distribution, the following stages must be followed.

  1. Build the entire TypeCobolBuilder solution

  2. Goto to the directory TypeCobolBuild\JTCB

  3. Run the DOS batch command file Build.bat depending of the the build tool of your choice (Maven or Gradle) execute the following command line.

** Build maven

** Build gradle

  1. This steps above will create a dist directory which contains a JTCB.jar file with a TCB directory.

Running JTCB

  1. First JTCB needs a connection to a RTC repository.

  2. To execute JTCB for generating a COBOL file from a TypeCobol use the following command line.

  • java -jar JTCB.jar -i=type_cobol_input_file -o=cobol_output_file -r rtc_url_repository -t rtc_target_stream_name -C rtc_source_component_name -s rtc_source_workspace_or_stream_name

with:

type_cobol_input_file : full path of the TypeCobol input file

cobol_output_file : the full path of the Cobol output file

cobol_output_file : An RTC URL repository (like : https://hub.jazz.net/ccm30)

rtc_target_stream_name : The name of a target RTC Stream in the RTC repository

rtc_source_component_name : The name of Component if the source RTC Workspace or Stream

rtc_source_workspace_or_stream_name : The name of the source RTC Workspace or Stream.