Skip to content

Commit

Permalink
Put samples in features/samples when initialising new project
Browse files Browse the repository at this point in the history
  • Loading branch information
bjuric committed Oct 29, 2024
1 parent 1636354 commit ff15b1b
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 29 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
4.0.0
=====
28 October 2024
30 October 2024
- Introduce Gwen processes to support multiple launch configurations
- `-p|--process` option
- Require Java 17+ instead of Java 11+
- Use logback instead of log4j for logging
- Support `empty` literal in DSLs wherever `blank` is accepted
- Replace internal stack of data caches with a single data cache (internal enhancement)
- Make all input data read only by default
- Added `--repl` option to force open REPL even if batch was specified
- Add `--repl` option to open REPL regardless of batch and feature options
- Put samples in features/samples when initialising new project
- Internal engine enhancements
- Replace internal stack of data caches with a single data cache
- Manage settings internally without exposing them as system properties
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/init/conf/process/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Environments
============
Processes
=========

Maintain your process settings here.

For help, see the [Gwen documentation](https://gweninterpreter.org/docs).
For help, see [Gwen processes](https://gweninterpreter.org/docs/processes)
4 changes: 2 additions & 2 deletions src/main/resources/init/conf/process/samples.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

gwen {
launch { # Samples launch options
options { # See: https://gweninterpreter.org/docs/settings#launch-settings
options { # See: https://gweninterpreter.org/docs/processes
features = [
"${gwen.baseDir}/samples"
"${gwen.baseDir}/features/samples"
]
inputData = ""
meta = [
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/init/features/samples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Samples
=======

This folder containes examples bundled with Gwen. Delete it and the conf/process/samples.conf file if you don't want to keep them.
4 changes: 0 additions & 4 deletions src/main/resources/init/samples/README.md

This file was deleted.

31 changes: 15 additions & 16 deletions src/main/scala/gwen/web/init/WebProjectInitialiser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,23 @@ trait WebProjectInitialiser extends ProjectInitialiser {

new File(dir, "features") tap { dir =>
FileIO.copyClasspathTextResourceToFile("/init/features/README.md", dir, allowReplace = force)
new File(dir, "samples") tap { dir =>
FileIO.copyClasspathTextResourceToFile("/init/features/samples/README.md", dir, allowReplace = force)
new File(dir, "google") tap { dir =>
FileIO.copyClasspathTextResourceToFile("/init/features/samples/google/Google.feature", dir, allowReplace = force)
FileIO.copyClasspathTextResourceToFile("/init/features/samples/google/Google.meta", dir, allowReplace = force)
}
new File(dir, "todo") tap { dir =>
FileIO.copyClasspathTextResourceToFile("/init/features/samples/todo/Todo.feature", dir, allowReplace = force)
FileIO.copyClasspathTextResourceToFile("/init/features/samples/todo/Todo.meta", dir, allowReplace = force)
}
}
}

new File(dir, "meta") tap { dir =>
FileIO.copyClasspathTextResourceToFile("/init/meta/README.md", dir, allowReplace = force)
}

new File(dir, "samples/google") tap { dir =>
FileIO.copyClasspathTextResourceToFile("/init/samples/google/Google.feature", dir, allowReplace = force)
FileIO.copyClasspathTextResourceToFile("/init/samples/google/Google.meta", dir, allowReplace = force)
}
new File(dir, "samples/todo") tap { dir =>
FileIO.copyClasspathTextResourceToFile("/init/samples/todo/Todo.feature", dir, allowReplace = force)
FileIO.copyClasspathTextResourceToFile("/init/samples/todo/Todo.meta", dir, allowReplace = force)
}
new File(dir, "samples") tap { dir =>
FileIO.copyClasspathTextResourceToFile("/init/samples/README.md", dir, allowReplace = force)
}

if(copyRootReadme) {
FileIO.copyClasspathTextResourceToFile("/init/README.md", new File("."), allowReplace = false)
}
Expand Down Expand Up @@ -132,10 +131,10 @@ trait WebProjectInitialiser extends ProjectInitialiser {
|$filler│ ├── README.md
|$filler│ └── samples.conf
|$filler├── /features # Features (and associative meta)
|$filler── README.md
|$filler── /meta # Common meta
|$filler└── README.md
|$filler└── /samples # Sample features and meta
|$filler── README.md
|$filler│ └── /samples # Samples
|$filler└── /meta # Common meta
|$filler └── README.md
|
|""".stripMargin
)
Expand Down
9 changes: 7 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/sh

sbt universal:stage
cd target
rm -rf project
Expand All @@ -6,8 +8,11 @@ cd project
../universal/stage/bin/gwen init --docker --jenkins
../universal/stage/bin/gwen -p samples --parallel -b
../universal/stage/bin/gwen --process samples --dry-run --batch
../universal/stage/bin/gwen gwen/samples --parallel --dry-run
../universal/stage/bin/gwen gwen/features/samples --parallel --dry-run
GWEN_PROCESS=samples ../universal/stage/bin/gwen -bn
cd ..
rm -rf project
if [ $# -eq 0 ]
then
rm -rf project
fi
cd ..

0 comments on commit ff15b1b

Please sign in to comment.