Skip to content

Commit def2b9c

Browse files
committed
Merge branch 'maintenance'
2 parents 9947d80 + 8fbe39a commit def2b9c

File tree

107 files changed

+2292
-645
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+2292
-645
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
bin/
2+
target/
3+
.DS_Store
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
/*
2+
* Copyright 2007-present the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
import java.net.*;
17+
import java.io.*;
18+
import java.nio.channels.*;
19+
import java.util.Properties;
20+
21+
public class MavenWrapperDownloader {
22+
23+
private static final String WRAPPER_VERSION = "0.5.6";
24+
/**
25+
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
26+
*/
27+
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
28+
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
29+
30+
/**
31+
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
32+
* use instead of the default one.
33+
*/
34+
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
35+
".mvn/wrapper/maven-wrapper.properties";
36+
37+
/**
38+
* Path where the maven-wrapper.jar will be saved to.
39+
*/
40+
private static final String MAVEN_WRAPPER_JAR_PATH =
41+
".mvn/wrapper/maven-wrapper.jar";
42+
43+
/**
44+
* Name of the property which should be used to override the default download url for the wrapper.
45+
*/
46+
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
47+
48+
public static void main(String args[]) {
49+
System.out.println("- Downloader started");
50+
File baseDirectory = new File(args[0]);
51+
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
52+
53+
// If the maven-wrapper.properties exists, read it and check if it contains a custom
54+
// wrapperUrl parameter.
55+
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
56+
String url = DEFAULT_DOWNLOAD_URL;
57+
if(mavenWrapperPropertyFile.exists()) {
58+
FileInputStream mavenWrapperPropertyFileInputStream = null;
59+
try {
60+
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
61+
Properties mavenWrapperProperties = new Properties();
62+
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
63+
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
64+
} catch (IOException e) {
65+
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
66+
} finally {
67+
try {
68+
if(mavenWrapperPropertyFileInputStream != null) {
69+
mavenWrapperPropertyFileInputStream.close();
70+
}
71+
} catch (IOException e) {
72+
// Ignore ...
73+
}
74+
}
75+
}
76+
System.out.println("- Downloading from: " + url);
77+
78+
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
79+
if(!outputFile.getParentFile().exists()) {
80+
if(!outputFile.getParentFile().mkdirs()) {
81+
System.out.println(
82+
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
83+
}
84+
}
85+
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
86+
try {
87+
downloadFileFromURL(url, outputFile);
88+
System.out.println("Done");
89+
System.exit(0);
90+
} catch (Throwable e) {
91+
System.out.println("- Error downloading");
92+
e.printStackTrace();
93+
System.exit(1);
94+
}
95+
}
96+
97+
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
98+
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
99+
String username = System.getenv("MVNW_USERNAME");
100+
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
101+
Authenticator.setDefault(new Authenticator() {
102+
@Override
103+
protected PasswordAuthentication getPasswordAuthentication() {
104+
return new PasswordAuthentication(username, password);
105+
}
106+
});
107+
}
108+
URL website = new URL(urlString);
109+
ReadableByteChannel rbc;
110+
rbc = Channels.newChannel(website.openStream());
111+
FileOutputStream fos = new FileOutputStream(destination);
112+
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
113+
fos.close();
114+
rbc.close();
115+
}
116+
117+
}

.mvn/wrapper/maven-wrapper.jar

49.5 KB
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2+
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

.project

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>Alf-Reference-Implementation</name>
3+
<name>alf-ri</name>
44
<comment></comment>
55
<projects>
66
</projects>
77
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.m2e.core.maven2Builder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
813
</buildSpec>
914
<natures>
15+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
1016
</natures>
1117
</projectDescription>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
dist: trusty
2+
language: java
3+
jdk:
4+
- oraclejdk8
5+
install: skip
6+
script:
7+
- ./mvnw -v
8+
- ./mvnw clean install -f master
9+
- ./mvnw clean install
10+
- ./mvnw clean install -f tycho-pom.xml
11+
notifications:
12+
email:
13+
on_success: change
14+
on_failure: change
15+
cache:
16+
directories:
17+
- "$HOME/.m2"

README.md

Lines changed: 90 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Action Language for UML (Alf) <br> Open Source Reference Implementation
2-
_Copyright &copy; 2011-2019 Model Driven Solutions, Inc._
2+
_Copyright &copy; 2011-2020 Model Driven Solutions, Inc._
33

44
Alf is an action language for UML developed in response to the OMG <em>Concrete
55
Syntax for a UML Action Language</em> Request for Proposals. The Alf specification
@@ -27,8 +27,8 @@ The latest version of the implementation is available at http://alf.modeldriven.
2727

2828
## Licensing
2929

30-
Data Access Technology, Inc. is copyright owner of the source code for this implementation. For licensing terms, see
31-
the file [`LICENSING.txt`](https://github.com/ModelDriven/Alf-Reference-Implementation/blob/master/dist/LICENSING.txt).
30+
Model Driven Solutions, Inc., (formerly Data Access Technology, Inc.) is copyright owner of the source code for this implementation.
31+
For licensing terms, see the file [`LICENSING.txt`](https://github.com/ModelDriven/Alf-Reference-Implementation/blob/master/dist/LICENSING.txt).
3232

3333
## Installation
3434

@@ -41,9 +41,14 @@ The installation directory includes Unix (BASH) shell scripts and DOS batch file
4141
By default, the `Libraries` subdirectory is expected to be in the same directory as the scripts.
4242
If you move it, set the environment variable `ALF_LIB` to its path.
4343

44+
## Further Information
45+
46+
The following sections describe the project structure and build steps for the implementation. For further information on using it,
47+
see the [wiki](https://github.com/ModelDriven/Alf-Reference-Implementation/wiki/Home).
48+
4449
## Projects
4550

46-
The implementation source is organized into four [Eclipse](http://www.eclipse.org) projects. Eclipse 4.6 or later is required.
51+
The base implementation source is organized into the following [Eclipse](http://www.eclipse.org) projects. The build is currently tested on Eclipse 2020-06 (4.16).
4752

4853
* `org.modeldriven.alf` - This is the base project, including the
4954
Alf parser, static semantic checking and generic mapping to fUML.
@@ -64,10 +69,88 @@ metamodel implementation (v5.2.0 or later). It depends on Eclipse plugins and mu
6469
* `org.modeldriven.alf.eclipse.moka` - This project extends the
6570
`org.modeldriven.alf.eclipse` project to allow compiled Alf text to be executed
6671
using the fUML execution engine from the [Moka framework](http://wiki.eclipse.org/Papyrus/UserGuide/ModelExecution)
67-
for model execution in the [Eclipse Papyrus](http://www.eclipse.org/papyrus) modeling tool (v3.1.0 or later).
72+
for model execution in the [Eclipse Papyrus](http://www.eclipse.org/papyrus) modeling tool (specifically v3.1.0).
6873
It depends on Eclipse plugins and must be built in an Eclipse environment. (Note: This project was called
6974
`org.modeldriven.alf.eclipse.papyrus` in previous versions of the reference implementation.)
7075

71-
## Further Information
76+
* `org.modeldriven.alf.tests` - This project provides automated tests.
77+
78+
## Building
79+
80+
### Maven project structure
81+
82+
The project structure under Maven allows building the regular Java modules and the Eclipse-based modules (using [Tycho](https://www.eclipse.org/tycho/)).
83+
84+
#### Master module build
85+
86+
* `./master/pom.xml` - a module that provides standard configurations to be shared by all modules, including the root module.
87+
88+
#### Regular Java build
89+
90+
* `./pom.xml` - the parent module for the regular Java modules
91+
* `./org.modeldriven.alf` - see [Projects](#Projects) above.
92+
* `./org.modeldriven.alf.fuml.impl` - see [Projects](#Projects) above.
93+
* `./org.modeldriven.alf.tests` - see [Projects](#Projects) above.
94+
* `./org.modeldriven.alf.bundle` - produces a OSGi-bundle from org.modeldriven.alf
95+
* `./org.modeldriven.alf.fuml.impl.bundle` - produces a OSGi-bundle from org.modeldriven.alf.fuml.impl
96+
97+
#### Tycho build
98+
99+
* `./tycho-pom.xml` - a convenience module that can be used for performing the Tycho (OSGi) aware part of the build. Equivalent to building `./tycho-parent/pom.xml`
100+
* `./tycho-parent/pom.xml` - the parent module for the Tycho/Eclipse modules
101+
* `./org.modeldriven.alf.eclipse` - see [Projects](#Projects) above.
102+
* `./org.modeldriven.alf.eclipse.moka` - see [Projects](#Projects) above.
103+
104+
### Steps
105+
106+
1. Master module build (required only once):
107+
108+
```
109+
mvn clean install -f master
110+
```
111+
112+
2. To perform the regular Java build, execute from the root directory:
113+
114+
```
115+
mvn clean install
116+
```
117+
118+
3. To perform the Tycho build, execute from the root directory:
119+
120+
```
121+
mvn clean install -f tycho-pom.xml
122+
```
123+
124+
## Importing into Eclipse
125+
126+
### Prerequisites
127+
128+
1. Eclipse JDT - Java development tools
129+
2. Eclipse PDE - Plug-in development environment
130+
3. Eclipse M2E - Maven Integration in Eclipse
131+
132+
By downloading the Eclipse SDK, you should have all those components.
133+
134+
### Importing as Eclipse projects
135+
136+
That is the simplest way to import the codebase into Eclipse.
137+
138+
1. Import the root directory location using the "Existing Projects into Workspace" option, making sure to select the "Search for nested projects" option.
139+
2. Configure the [target platform](https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Fguide%2Ftools%2Fpreference_pages%2Ftarget_platform.htm)
140+
preferences to use the `alf-ri.target` definition you just imported
141+
3. You may be asked to install M2E extensions to support Tycho projects - this is recommended.
142+
143+
144+
### Importing as Maven modules
145+
146+
Alternately, you can import the code as Maven modules, which is recommended to obtain a configuration that is consistent with how the Maven build operates on the codebase.
147+
148+
1. Import the repository root directory and all its children artifacts as "Existing Maven projects" (note that will *not* include the `alf.eclipse` and `alf.eclipse.moka projects`,
149+
as they are *not* modules for the base Maven build).
150+
**Note:** If you see a build problem with the message "*Duplicate bundle executions found. Please remove any explicitly defined bundle executions in your pom.xml.*",
151+
make any non-content change to the POM file and save it, which should make the error go away.
152+
2. Import the `tycho-parent` directory and all its children artifacts as "Existing Maven projects".
153+
3. Configure the [target platform](https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Fguide%2Ftools%2Fpreference_pages%2Ftarget_platform.htm) preferences
154+
to use the `alf-ri.target` definition you just imported
155+
4. You may be asked to install M2E extensions to support Tycho projects - this is recommended.
72156

73-
For further information on using the implementation, see the [wiki](https://github.com/ModelDriven/Alf-Reference-Implementation/wiki/Home).

dist/LICENSING.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Action Language for UML (Alf) Open Source Reference Implementation
22
Licensing Information
33

4-
Data Access Technologies Inc.(Model Driven Solutions) is the copyright owner
5-
of the source code in this software entitled the Action Language for UML (Alf)
4+
Model Driven Solutions, Inc. (formerly Data Access Technologies Inc.) is the copyright
5+
owner of the source code in this software entitled the Action Language for UML (Alf)
66
Open Source Reference Implementation (the "Software"). The copyright owner hereby
77
licenses such Software to you for use under the GNU General Public License (GPL)
88
version 3 (at http://www.gnu.org/licenses/gpl-3.0.html and attached hereto as

0 commit comments

Comments
 (0)