New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Have a flatter directory structure similar to Mill with less boilerplate #344
Comments
Hey @carlosedp , thanks for the input. You can have a pretty flat structure for the projects if you want! The mechanism works like this:
If you then say something like this : template-common:
# ...
source-layout: none
sources: ./src2 and create directories: $ bleep build create-directories
📗 (0 ms) Launching Bleep version 0.0.2 as requested in /Users/oyvind/bleep/flaff/bleep.yaml
📙 (5 ms) Refreshing /Users/oyvind/bleep/flaff/.bleep/builds/normal/.bloop...
📗 (11 ms) wrote bloop files [value => Changed: 3]
📗 (11 ms) bootstrapped in 12 ms
📗 (12 ms) Created /Users/oyvind/bleep/flaff/tests/src2 [value => [tests]]
📗 (12 ms) Created /Users/oyvind/bleep/flaff/flaff/src2 [value => [flaff]] Nested test projectsThat's a pass, I'm sorry. These are the reasons:
|
Thanks a lot for your amazingly complete answer Oyvind! Agree with you on nesting the test projects... sometimes we are so used to do it and don't ask ourselves if it really helps or it's just something we do because the tooling does that way. The solution is perfectly clean as it is now. I understand the Again, thanks a lot for the great tool, I look forward to start using it for some projects! |
Just for documenting, my sample project became: # yaml-language-server: $schema=https://raw.githubusercontent.com/oyvindberg/bleep/master/schema.json
$schema: https://raw.githubusercontent.com/oyvindberg/bleep/master/schema.json
$version: 0.0.2
jvm:
name: graalvm-java17:22.3.2
projects:
httpserver:
dependencies:
- dev.zio::zio-http:3.0.0-RC2
- dev.zio::zio:2.0.15
extends: template-common
platform:
mainClass: ZioHttpApp
httpserver-test:
dependencies:
- dev.zio::zio-test-sbt:2.0.15
- dev.zio::zio-test:2.0.15
dependsOn: httpserver
extends: template-common
isTestProject: true
testFrameworks: zio.test.sbt.ZTestFramework
templates:
template-common:
source-layout: none
sources: ./src
resources: ./resources
platform:
name: jvm
scala:
options: -Wunused:all -Wvalue-discard -deprecation -feature -unchecked
version: 3.3.0 |
BTW, to make the Json schema work on VSCode using the YAML extension (https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml), you need to either configure VSCode settings itself to load the schema or add a modeline to each file. Globally adding to VSCode settings.json config: ...
"yaml.schemas": {
"https://raw.githubusercontent.com/oyvindberg/bleep/master/schema.json": [
"bleep.yaml"
]
},
... Or add to each bleep.yaml:
|
Thanks for the info! The |
Ah yes, it could add the settings above to the project's |
FYI, I've opened an issue to the YAML Extension... |
It would be great to have a flatter directory structure, similar to Mill also in a way that the test module would be nested into it's main module with less boilerplate in the yaml.
Currently the closest using
source-layout: normal
which is the default is:This requires setting the folders as:
It would be great to have a layout like:
Where the
isTestProject
and thedependsOn
settings could be leveraged nesting thetest
module intohttpserver
.What do you think? Maybe not nesting
test
leads to less API breakage, so another option would be having the test project in the same level but having a flag indicating to which project it belongs.The text was updated successfully, but these errors were encountered: