Skip to content

Commit 7b88a4a

Browse files
committed
Merge branch '__rultor'
2 parents a41b4ee + 8d7b9ab commit 7b88a4a

File tree

4 files changed

+36
-8
lines changed

4 files changed

+36
-8
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,9 @@ output_eo
99
polystat_check
1010
/hadoop/
1111
/output_hadoop/
12+
/bin
13+
/project
14+
.metals/
15+
.vscode
16+
hadoop*
17+
J2EO*.jar

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ This is a translator of **Java** programming language to [EOLANG](https://www.eo
3737
```shell
3838
./build.sh
3939
```
40+
- See the [troubleshooting section](./README.md#troubleshooting) in case of problems
4041
4. After build process, **j2eo.jar** file will appear in the project root folder (`./j2eo`). With this file, is it
4142
possible to translate **.java** files or packages to **.eo** packages. Run:
4243

@@ -67,6 +68,10 @@ Usage:
6768
./test-hadoop.sh
6869
```
6970

71+
It will download zipped `hadoop` and unpack it (in a separate folder) into `../j2eo-data` relative to the project's root. Next, it will put the If you no more need that folder, run
72+
```sh
73+
rm -rf ../j2eo-data
74+
```
7075
7176
---
7277
@@ -103,3 +108,14 @@ bugs in our code. It is also much easier to work with abstraction layer than wit
103108
- First, the Java source code files are parsed recursively.
104109
- Then, for each file, translator converts Java AST to EO AST.
105110
- Then, EO AST is printed out as a source code to output directory in the same directory structure.
111+
112+
## Troubleshooting
113+
114+
### Java
115+
Make sure you have these in sync (*mentioning* (not pointing to) the same `jdk` directory)
116+
- `which java`
117+
- `which javac`
118+
- configure alternatives in case of mismatch ([link](https://stackoverflow.com/a/47432365))
119+
- `echo $JAVA_HOME`
120+
- See how to set `$JAVA_HOME` ([link](https://stackoverflow.com/a/18972665))
121+
- If it still points to a wrong directory, see where you might have set it ([link](https://unix.stackexchange.com/a/154957)) and edit that place

build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
set -e
55

66
echo "Building J2EO..."
7-
rm -r build/libs
7+
# don't throw error if a dir doesn't exist
8+
rm -rf build/libs
89
./gradlew fatJar -x test
910
cp build/libs/* ./
1011
echo "Build completed"

test-hadoop.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ echo "Building J2EO..."
77
./gradlew build -x test jar
88
cp build/libs/J2EO-0.4.0.jar .
99

10-
echo "Cloning Hadoop..."
11-
git clone https://github.com/apache/hadoop || true
12-
cd hadoop || exit
13-
echo "Checking out tested revision..."
14-
git checkout ec0ff1dc04b2ced199d71543a8260e9225d9e014
15-
cd ..
10+
echo "Downloading Hadoop..."
11+
# get hadoop from https://www.apache.org/dyn/closer.cgi/hadoop/common/hadoop-3.2.3/hadoop-3.2.3-src.tar.gz
12+
mkdir ../j2eo-data
13+
wget -O ../j2eo-data/hadoop.tar.gz https://dlcdn.apache.org/hadoop/common/hadoop-3.2.3/hadoop-3.2.3-src.tar.gz
14+
# unpack
15+
tar -xf ../j2eo-data/hadoop.tar.gz -C ../j2eo-data
1616

1717
echo "Starting J2EO on Hadoop..."
18-
java -jar J2EO-0.4.0.jar -o output_hadoop hadoop
18+
# clean old output
19+
rm -rf ../j2eo-data/hadoop-eo
20+
21+
# as it's not a part of the project
22+
# we may want to output to the parent directory
23+
java -jar J2EO-0.4.0.jar -o ../j2eo-data/hadoop-eo ../j2eo-data/hadoop-3.2.3-src

0 commit comments

Comments
 (0)