-
Notifications
You must be signed in to change notification settings - Fork 4
/
new.sh
executable file
·29 lines (25 loc) · 852 Bytes
/
new.sh
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
#!/bin/bash
#
# Run bnd cli to add new project
#
# @author Tim Lauv
# @created 2017.08.01
# Create a default bnd sub project in the bnd workspace
java -jar ./tools/bnd/dist/bnd.jar -b ./subprojects add project "$1"
# Create gradle sub project layout (customized in root build.gradle)
touch ./subprojects/"$1"/build.gradle
mkdir ./subprojects/"$1"/src/java
mkdir ./subprojects/"$1"/src/scala
mkdir ./subprojects/"$1"/src/resources
mkdir ./subprojects/"$1"/test/java
mkdir ./subprojects/"$1"/test/scala
mkdir ./subprojects/"$1"/test/resources
# Add the gradle sub project to root build
echo -e "\ninclude \"$1\"" >> ./settings.gradle
echo -e "project(\":$1\").projectDir = file(\"subprojects/$1\")" >> ./settings.gradle
gradle :$1:idea
echo ""
echo "============="
echo "Do NOT forget to include $@ in /settings.gradle"
echo "============="
echo ""