-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·92 lines (75 loc) · 2.54 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·92 lines (75 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
# Update and upgrade system packages
sudo apt update -y
sudo apt upgrade -y
echo "Installing Java..."
sudo apt install -y openjdk-17-jdk
echo "Installed Java."
echo "Installing Maven..."
sudo apt install -y maven
echo "Installed Maven."
echo "Installing Python3 and its dependencies..."
sudo apt install -y python3 python3-pip
echo "alias py='python3'" >> ~/.bashrc
source ~/.bashrc
sudo apt install -y python3-venv
echo "Installed Python3 and set alias 'py'."
# Dependencies for PowerJoular
sudo apt install -y gprbuild
sudo apt install -y gnat
# Install PowerJoular
echo "Cloning edited PowerJoular repository..."
git clone https://github.com/afonsoCarreira1/powerjoular_edited.git
cd powerjoular_edited/powerjoular/installer/bash-installer
echo "Running installer..."
bash build-install.sh
echo "Installation complete."
sudo chmod +x /usr/bin/powerjoular # Make powerjoular executable if needed
cd ../../../..
sudo rm -rf powerjoular_edited
# Compile codegen
echo "Compiling codegen..."
cd codegen/
sudo find src/main/java/com/generated_progs/ -type d -exec rm -r {} +
sudo find src/main/java/com/generated_templates/ -type d -exec rm -r {} +
mvn install
mvn dependency:build-classpath -Dmdep.outputFile=cp.txt
mvn clean compile assembly:single
mvn install:install-file -Dfile=target/codegen-1.0-SNAPSHOT-jar-with-dependencies.jar \
-DgroupId=com.template -DartifactId=codegen -Dversion=1.0-SNAPSHOT -Dpackaging=jar
# Compile parser
echo "Compiling parser..."
cd ..
cd parser/
mvn clean install -U
mvn clean compile assembly:single
mvn install:install-file -Dfile=target/parser-1.0-SNAPSHOT-jar-with-dependencies.jar \
-DgroupId=com.parse -DartifactId=parser -Dversion=1.0-SNAPSHOT -Dpackaging=jar
# Compile orchestrator
echo "Compiling orchestrator..."
cd ..
export MAVEN_OPTS="-Xmx512m -Xms128m -Xss2m"
cd orchestrator/
mvn versions:update-parent versions:update-properties versions:use-latest-releases -DgenerateBackupPoms=false # Update pom
mvn dependency:build-classpath -Dmdep.outputFile=cp.txt
mvn clean compile assembly:single -U
cd ..
echo "All projects compiled."
# Create virtual environment for Python
cd ml/
VENV_DIR="venv"
# Create venv if it doesn't exist
if [ ! -d "$VENV_DIR" ]; then
echo "Creating virtual environment..."
python3 -m venv "$VENV_DIR"
fi
# Activate venv
source "$VENV_DIR/bin/activate"
# Upgrade pip
pip install --upgrade pip
# Install dependencies
pip install -r requirements.txt
# Deactivate venv
deactivate
echo "Environment created. To activate it enter the ml directory and run: source $VENV_DIR/bin/activate"
cd ..