java - how to create a resources directory using gradle init? -
why doesn't init
create resources
directory?
thufir@doge:~/netbeansprojects$ thufir@doge:~/netbeansprojects$ mkdir foobar thufir@doge:~/netbeansprojects$ cd foobar/ thufir@doge:~/netbeansprojects/foobar$ thufir@doge:~/netbeansprojects/foobar$ gradle init --type java-library :wrapper :init build successful total time: 6.187 secs thufir@doge:~/netbeansprojects/foobar$ thufir@doge:~/netbeansprojects/foobar$ tree . ├── build.gradle ├── gradle │ └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src ├── main │ └── java │ └── library.java └── test └── java └── librarytest.java 7 directories, 8 files thufir@doge:~/netbeansprojects/foobar$
this in context of ensuring files package in jar
file.
perhaps there's alternate init
creates directory? (yes, directory can manually created -- that's not question.)
related to:
47.4.1. changing project layout
you configure project layout configuring appropriate source set. discussed in more detail in following sections. here brief example changes main java , resource source directories.
example 47.2. custom java source layout build.gradle sourcesets { main { java { srcdirs = ['src/java'] } resources { srcdirs = ['src/resources'] } } }
gradle should following standard directory layout maven specifies as:
my-app |-- pom.xml `-- src |-- main | |-- java | | `-- com | | `-- mycompany | | `-- app | | `-- app.java | `-- resources | `-- meta-inf | `-- application.properties `-- test `-- java `-- com `-- mycompany `-- app `-- apptest.java
so...why doesn't gradle follow convention?
notably, netbeans creates proper structure:
thufir@doge:~/netbeansprojects/singlegradle$ thufir@doge:~/netbeansprojects/singlegradle$ tree . ├── build.gradle ├── settings.gradle └── src ├── main │ ├── java │ │ └── foo │ │ └── main.java │ └── resources └── test ├── java └── resources 8 directories, 3 files thufir@doge:~/netbeansprojects/singlegradle$
Comments
Post a Comment