README 9.01 KB
Newer Older
Elemer Lelik's avatar
Elemer Lelik committed
1
###############################################################################
2
# Copyright (c) 2000-2016 Ericsson Telecom AB
Elemer Lelik's avatar
Elemer Lelik committed
3
4
5
6
7
8
9
10
11
12
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
###############################################################################
#README file for the innersourced Titan Eclipse plugins project

1. VERSION REQUIREMENTS

Java 1.6 or higher, recommended: 1.7
Elemer Lelik's avatar
Elemer Lelik committed
13
14
15
ANTLR 4 SDK 0.3.5
ANTLR Runtime 4.3 or higher, recommended: 4.3, available at Eclipse Orbit
Ant 1.9.2 or higher 
Elemer Lelik's avatar
Elemer Lelik committed
16
  NOTE: Build will not work below 1.8 for sure!
Elemer Lelik's avatar
Elemer Lelik committed
17
Eclipse Standard or Java 3.6 (Helios) or higher, recommended: 4.4 (Luna)
Elemer Lelik's avatar
Elemer Lelik committed
18
19
20
21
22
23
24
25
26
27
28

----------------------
2. SETTING UP ECLIPSE FOR TITAN DEVELOPMENT
 
2.1. Installing Eclipse plug-ins:
Eclipse -> Help -> Install New Software...
  Contact all update sites during install to find required software -> ALWAYS SWITCH OFF (it can cause problems)

ANTLR
http://antlreclipse.sourceforge.net/updates/

Elemer Lelik's avatar
Elemer Lelik committed
29
30
31
Titan plug-ins
from the Titan update site
TODO: add URL
Elemer Lelik's avatar
Elemer Lelik committed
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

Set the new JDK in Window -> Preferences -> Java -> Installed JREs

Window->Preferences->TITAN Preferences:
  TITAN installation path: <git repository>/titan/Install
  License file (optional, only if license checking is switched on): /home/<user id>/license_<license id>.dat

2.2. Importing Titan plug-in projects to Eclipse
Add "Git Repository Exploring" perspective
Add an existing local Git repository
  Choose titan and titan_eclipse, finish
titan_eclipse: right click -> import projects... -> next -> finish

2.3. Other recommended settings
Project property (right click, properties) -> TITAN Project Property -> Internal makefile creation attributes (middle tab) ->
  Include source line info in C++ code (-l) -> switch on
  Add source line info for logging (-L) -> switch on

Add TITAN Editing perspective
Add TITAN Executing perspective

windows/customize perspective/commands groups availability -> "Launch" switch on

----------------------
3. SWITCHING ON TITAN LICENSE CHECKING AND USAGE STATISTICS SENDING

By default Titan license checking and usage statistics sending are switched off. You can switch them on by running the following script:

<git repository>/titan_eclipse/license.sh

It modifies the source, you need to rebuild org.eclipse.titan.common plug-in project.

----------------------
4. BUILDING AND INSTALLING TITAN PLUG-INS FROM COMMAND LINE WITH ANT

Elemer Lelik's avatar
Elemer Lelik committed
67
68
4.1. EXTERNAL JAR DEPENDENCIES

Elemer Lelik's avatar
Elemer Lelik committed
69
  antlr-4.3-complete.jar 
Elemer Lelik's avatar
Elemer Lelik committed
70
    available at Eclipse Orbit
Elemer Lelik's avatar
Elemer Lelik committed
71
72
73
    http://download.eclipse.org/tools/orbit/downloads/drops/S20150519210750/
    NOTE: The drop version changes very often.
  junit.jar (JUnit4)
Elemer Lelik's avatar
Elemer Lelik committed
74

Elemer Lelik's avatar
Elemer Lelik committed
75
  These jars are needed by help.plugin to create pdf documentation
Elemer Lelik's avatar
Elemer Lelik committed
76
    PDF documentation can be created only inside Ericcson network
Elemer Lelik's avatar
Elemer Lelik committed
77
78
79
80
81
82
83
84
85
86
87
88
    doc2pdf.jar (optional, pdf will not be created if file not found at this location)
      For Ericsson users only: Download the plugin from http://ttcn.ericsson.se/download/third_party/ OR write to any contact person at Project Titan

  These jars are needed by titanium.plugin
    org.apache.commons.collections15/collections-generic-4.01.jar
      Download Commons-Collections from http://commons.apache.org/proper/commons-collections/
      OR for Ericsson users only: Download the Jung plugin from  http://ttcn.ericsson.se/download/third_party/commons.collections.zip 
      OR for users outside Ericsson: Write to any contact person on site https://projects.eclipse.org/projects/tools.titan and ask the commons.collections.zip .
    edu.uci.ics.jung/jung-graph-impl-2.0.1.jar
    edu.uci.ics.jung/jung-visualization-2.0.1.jar
    edu.uci.ics.jung/jung-algorithms-2.0.1.jar
    edu.uci.ics.jung/jung-io-2.0.1.jar
Elemer Lelik's avatar
Elemer Lelik committed
89
      For Ericsson users only: Download the Jung plugin from http://ttcn.ericsson.se/download/third_party/edu.uci.ics.jung.zip 
Elemer Lelik's avatar
Elemer Lelik committed
90
91
      OR for users outside Ericsson: Write to any contact person on site https://projects.eclipse.org/projects/tools.titan and ask the jung.zip  
    org.apache.poi_3.9.0.v201405241750.jar
Elemer Lelik's avatar
Elemer Lelik committed
92
      available at Eclipse Orbit
Elemer Lelik's avatar
Elemer Lelik committed
93
94
      http://download.eclipse.org/tools/orbit/downloads/drops/S20150519210750/
      NOTE: The drop version changes very often.
Elemer Lelik's avatar
Elemer Lelik committed
95
96
97

4.2. BUILDING TITAN PLUG-INS FROM COMMAND LINE WITH ANT

Elemer Lelik's avatar
Elemer Lelik committed
98
Building must be run from <git repository>/titan_eclipse/automatic_build
Elemer Lelik's avatar
Elemer Lelik committed
99

Elemer Lelik's avatar
Elemer Lelik committed
100
In general building from command line is done with this command:
Elemer Lelik's avatar
Elemer Lelik committed
101
102
103
104
105
106
107
108
109
ant \
-f build_main.xml \
-D<environment value definition 1> \
...
-D<environment value definition n> \
-lib <JAR dependency 1> \
...
-lib <JAR dependency n> \
<target>
Elemer Lelik's avatar
Elemer Lelik committed
110
111
112
113
114
115
116
117
118
119
120

target can be one of the following:
  common.plugin
  designer.plugin
  executor.plugin
  help.plugin
  logviewer.plugin
  debug.plugin
  regressiontests.plugin
  titanium.plugin
  titanium.regressiontests.plugin
Elemer Lelik's avatar
Elemer Lelik committed
121
122
123
124
125
  updatesite.release
  updatesite.FOA
  updatesite.experimental
  updatesite.testing
  zip
Elemer Lelik's avatar
Elemer Lelik committed
126
127
128
129
130
131
132
133
134
135
136
137

Make sure, that the following environment variables are set to a valid directory/file:

JAVA_HOME
ECLIPSE_HOME
compiler.location: this is the titan project directory: <git repository>/titan
java6: a java6 executable
updatesite.experimental.location: output directory for experimental update site (optional)
updatesites.tmp.location: temporary output directory for experimental update site (optional)
zip.dir: output directory for zip package that contains all the plug-ins (optional)

These variables can be set by editing <git repository>/titan_eclipse/automatic_build/build_config.xml
Elemer Lelik's avatar
Elemer Lelik committed
138
and also in the command.
Elemer Lelik's avatar
Elemer Lelik committed
139

Elemer Lelik's avatar
Elemer Lelik committed
140
4.2.1. A working example with all of the dependencies (if all the values are set correctly, it will work with any target):
Elemer Lelik's avatar
Elemer Lelik committed
141
142
143
144
145

LIB_DIR_LOCAL=$HOME/lib
LIB_DIR_GIT=$HOME/git/titan_playground/jar
ant \
-f build_main.xml \
Elemer Lelik's avatar
Elemer Lelik committed
146
147
148
-DJAVA_HOME=$HOME/jdk/ \
-DECLIPSE_HOME=$HOME/eclipse/ \
-Dcompiler.location=$HOME/git/titan/ \
Elemer Lelik's avatar
Elemer Lelik committed
149
150
-Dantlr4.jar.location=${LIB_DIR_LOCAL}/antlr-4.3-complete.jar \
-Ddoc2pdf.jar=${LIB_DIR_GIT}/doc2pdf.jar \
Elemer Lelik's avatar
Elemer Lelik committed
151
-Djava6=$HOME/jdk/bin/java \
Elemer Lelik's avatar
Elemer Lelik committed
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
-lib ${LIB_DIR_GIT}/edu.uci.ics.jung/jung-graph-impl-2.0.1.jar \
-lib ${LIB_DIR_GIT}/edu.uci.ics.jung/jung-visualization-2.0.1.jar \
-lib ${LIB_DIR_GIT}/edu.uci.ics.jung/jung-algorithms-2.0.1.jar \
-lib ${LIB_DIR_GIT}/edu.uci.ics.jung/jung-io-2.0.1.jar \
-lib ${LIB_DIR_GIT}/org.apache.commons.collections15/collections-generic-4.01.jar \
-lib ${LIB_DIR_LOCAL}/org.apache.poi_3.9.0.v201405241750.jar \
-lib ${LIB_DIR_GIT}/org.junit_4.11.0.v201303080030/junit.jar \
-Dupdatesite.release.location=result/update_site \
-Dupdatesite.FOA.location=result/FOA_update_site \
-Dupdatesite.experimental.location=result/experimental_update_site \
-Dupdatesite.testing.location=result/testing_update_site \
-Dupdatesites.tmp.location=result/eclipse_automatic_build/tmp_update_sites \
-Dzip.dir=result/zips/4.2.0.CRL_113_200_4_R2A \
zip

4.2.2. A working example with minimal requirements, with a target with few dependencies

ant \
-f build_main.xml \
-DJAVA_HOME=$HOME/jdk/ \
-DECLIPSE_HOME=$HOME/eclipse/ \
-Dantlr4.jar.location=$HOME/lib/antlr-4.3-complete.jar \
-Dcompiler.location=$HOME/git/titan/ \
Elemer Lelik's avatar
Elemer Lelik committed
175
176
designer.plugin

Elemer Lelik's avatar
Elemer Lelik committed
177
4.3. INSTALLING PLUG-INS TO ECLIPSE
Elemer Lelik's avatar
Elemer Lelik committed
178
179
180
181
The plug-in jars are created in result/plugins/ directory.
Copy these *.jar files to $ECLIPSE_HOME/plugins/ directory.

----------------------
Elemer Lelik's avatar
Elemer Lelik committed
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
5. RUNNING REGRESSION TEST

5.1. Prerequisites:
  5.1.1. org.eclipse.titan.titanium plug-in is built
  5.1.2. The following plug-ins are present in eclipse/plugins directory in this structure
           edu.uci.ics.jung/
             jung-graph-impl-2.0.1.jar
             jung-visualization-2.0.1.jar
             jung-algorithms-2.0.1.jar
             jung-io-2.0.1.jar
           org.apache.commons.collections15/
             collections-generic-4.01.jar
           org.antlr.runtime_4.3.0.v201502022030.jar
           org.apache.poi_3.9.0.v201405241750.jar
  5.1.3. Titan jars are also copied to eclipse/plugins
         cp -f result/plugins/* ${ECLIPSE_INSTALLED}/plugins
  5.1.4. The folowing environemnt variables are set
         JAVA_HOME
         WORKSPACE
         TTCN3_LICENSE_FILE
         TEST_PROJ
         TARGET_WS

5.2. Running regression tests:
  Tests must be run from titan_eclipse/automatic_build
  This is a content of a script, that runs the tests
  
#!/bin/bash

# USAGE: run from git/titan_eclipse/automatic_build/
# Prerequisites: build_titan_eclipse_regressiontests_plugin.sh

set -e
set -o pipefail

JAVA_HOME=$HOME/jdk/
WORKSPACE=$HOME/git
TTCN3_LICENSE_FILE=$HOME/license.dat
TEST_PROJ=file://${WORKSPACE}/titan_eclipse
TARGET_WS=${WORKSPACE}/ws_test
echo "eclipse_ws: ${TEST_PROJ}"
ECLIPSE_INSTALLED=eclipse

# extract a fresh eclipse
tar -zxvf $HOME/install/eclipse-rcp-luna-SR2-linux-gtk.tar.gz ${ECLIPSE_INSTALLED}/

# copy required jars (5.1.2.)
cp -f -r $HOME/install/eclipse_plugins/* ${ECLIPSE_INSTALLED}/plugins

# copy titan jars to eclipse/plugins (5.1.3.)
cp -f result/plugins/* ${ECLIPSE_INSTALLED}/plugins

${ECLIPSE_INSTALLED}/eclipse \
-debug \
-noSplash \
-data ${TARGET_WS} \
-clean \
-application org.eclipse.titan.regressiontests.HeadlessRunner \
-workspace ${TEST_PROJ} \
-license ${TTCN3_LICENSE_FILE} \
-xml_out result.xml