[docs] best practice directory structure

486 views
Skip to first unread message

o...@wix.com

unread,
Mar 15, 2017, 8:52:19 AM3/15/17
to bazel-discuss
Hi,

As someone that wants to start a new project (in my case  - Java/Scala project) - I want to use the best practice directory structure.
I don't know if it's intentionally - but I'm missing a page in the docs that describes it.

There are several project types:
  • one module project
  • multiple modules - same language
  • multiple modules - multiple languages
And with respect to those where to put:
  • source code
  • resources
  • scripts
  • docker files
  • unit tests
  • integration tests
  • custom rules / macros
  • test of custom rules / macros.
I can follow maven structure for java like here but looking at examples, I can't find one best practice that works well.

It would be really great to start writing a page for that in the docs.

Marcel Hlopko

unread,
Mar 15, 2017, 9:32:13 AM3/15/17
to o...@wix.com, bazel-discuss, kcho...@google.com, dmar...@google.com
I guess I don't have much experience with setting up projects using Bazel. You can mimic what we do in Bazel repo. Adding +Kristina Chodorow if she has anything more to say about this. Or +Damien Martin-guillerez? :)

Anyway, page in the docs would be awesome! Our github wiki is world editable if you're up to it.

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/237cf844-f857-4f80-a0e0-6ddeb3d098e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
-- 
Marcel Hlopko | Software Engineer | hlo...@google.com | 

Google Germany GmbH | Erika-Mann-Str. 33  | 80636 München | Germany | Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle | Registergericht und -nummer: Hamburg, HRB 86891

Kristina Chodorow

unread,
Mar 15, 2017, 9:53:33 AM3/15/17
to Marcel Hlopko, o...@wix.com, bazel-discuss, dmar...@google.com
Bazel supports Maven's standard directory structure (src/{main,test}/{java,resources}) or the layout we use at Google internally (all Java code/resources under java/ and javattests/).  src/main/java is more typical in the outside world, so I'd recommend going with that.

I can follow maven structure for java like here but looking at examples, I can't find one best practice that works well.

Is there a particular problem you're running into?

o...@wix.com

unread,
Mar 15, 2017, 10:51:44 AM3/15/17
to bazel-discuss, hlo...@google.com, o...@wix.com, dmar...@google.com
Sorry Kristina. I didn't mean that it doesn't work well. I meant that I cannot find one that seems better / more common than the others.

Thanks for your answers. I'll use the standard directory structure.

In any case - don't you think that having such page in docs will help users adapt this tool more easily?

Kristina Chodorow

unread,
Mar 15, 2017, 2:39:47 PM3/15/17
to o...@wix.com, bazel-discuss, Marcel Hlopko, Damien Martin-guillerez
Yes, we definitely need more documentation on this!  We're working on it.

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/07226d76-e396-4388-aad4-7ca2fd795c69%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages