-
-
Notifications
You must be signed in to change notification settings - Fork 187
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·29 lines (24 loc) · 1.12 KB
/
bootstrap.sh
File metadata and controls
executable file
·29 lines (24 loc) · 1.12 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
## This script is an experiment to bootstrap jbang with jbang itself.
## in gradle we have plugin to generate BuildConfig with version info in it.
## For now just generate a placeholder. Ultimately could be some other script to generate the file.
mkdir -p generated/
cat << EOF > generated/BuildConfig.java
package dev.jbang.util;
public final class BuildConfig {
public static final String VERSION = "999-jbang";
public static final String NAME = "jbang";
private BuildConfig() {
}
}
EOF
# Use Gradle to get the implementation dependencies in a clean format
# this is done just to avoid having to double maintain the list of dependencies
DEPS=$(./gradlew dependencies --configuration compileClasspath --quiet | \
grep -E '^[+\\-]---' | \
sed -E 's/^[+\\-]+---[ \\]*//' | \
sed -E 's/ -> .*$//' | \
sed 's/ (\*)//' | \
grep -E '^[^:]+:[^:]+:[^:]+$' | \
sort -u | \
tr '\n' ',' | sed 's/,$//')
jbang export local --force -O jbang.jar --sources src/main/java,src/main/java9,generated --files src/main/resources --repos mavencentral --deps "$DEPS" src/main/java/dev/jbang/Main.java