Skip to content

Commit 5ef58d9

Browse files
committed
new egg, incomplete
1 parent 123b200 commit 5ef58d9

File tree

16 files changed

+398
-1
lines changed

16 files changed

+398
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Enable auto-env through the sdkman_auto_env config
2+
# Add key=value pairs of SDKs to use below
3+
java=19-open
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
Summary:
3+
---------
4+
5+
* this egg illustrates structured concurrency
6+
* two tasks: `foo` and `bar`
7+
- can be configured to succeed or fail
8+
* NOTE
9+
- happy path: one task takes X seconds; the other takes Y seconds
10+
- when one task is configured to fail, the other is interrupted
11+
12+
Build Notes:
13+
------------
14+
15+
* tested with [this jdk](../JDK.version.md)
16+
* tested with [this version](../Gradle.version.md) of Gradle
17+
* tested with [this version](../Maven.version.md) of Maven
18+
19+
To Run (using Gradle):
20+
---------------------
21+
22+
* `./gradle-run.sh [yes|no]`
23+
- arg indicates whether or not to shutdown
24+
25+
To Run (using Maven):
26+
---------------------
27+
28+
* `./mvn-run.sh`
29+
- set DO_SHUTDOWN command-line arg in `pom.xml`
30+
31+
To Run (using Bash):
32+
----------------------
33+
34+
* `./run.sh [yes|no]`
35+
- arg indicates whether or not to shutdown
36+
37+
useful commands:
38+
39+
* `sdk env`
40+
- SDKMan! will set JDK to value in `.sdkmanrc`
41+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
mainClassName = "net.codetojoy.Runner"
3+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
TARGET_DIR=./my_build
6+
7+
rm -rf $TARGET_DIR
8+
9+
echo "clean ok"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
CLASSPATH=.
6+
7+
ROOT_DIR=$PWD
8+
SRC_DIR=$ROOT_DIR/src/main/java
9+
TARGET_DIR=$ROOT_DIR/my_build/main
10+
11+
mkdir -p $TARGET_DIR
12+
13+
javac --release 19 --enable-preview \
14+
-cp $CLASSPATH \
15+
--add-modules jdk.incubator.concurrent \
16+
-d $TARGET_DIR `find $SRC_DIR -name "*.java"`
17+
18+
echo "compile ok"

egg_StackOverflow_74464598/go.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
./clean.sh
6+
./compile.sh
7+
./run.sh
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
../gradlew compileJava
6+
7+
echo "run complete"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [ -n "$1" ]; then
6+
DO_SHUTDOWN=$1
7+
else
8+
echo "usage: gradle-run.sh DO_SHUTDOWN=yes|no"
9+
exit -1
10+
fi
11+
12+
../gradlew run --args="$DO_SHUTDOWN"
13+
14+
echo "run complete"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
mvn install
6+
mvn clean
7+
mvn compile
8+
9+
echo "run complete"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [ -n "$1" ]; then
6+
DO_SHUTDOWN=$1
7+
else
8+
echo "usage: mvn-run.sh DO_SHUTDOWN=yes|no"
9+
exit -1
10+
fi
11+
12+
mvn install
13+
mvn clean
14+
mvn compile
15+
mvn exec:exec
16+
17+
# mvn exec:java -Dexec.mainClass="net.codetojoy.Runner" -Dexec.args="$DO_SHUTDOWN --add-modules=jdk.incubator.concurrent --enable-preview"
18+
19+
echo "run complete"

0 commit comments

Comments
 (0)