Skip to content
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

Gradle Plugin: Preserve directory structure #33

Closed
julioz opened this issue Jun 4, 2020 · 0 comments · Fixed by #37
Closed

Gradle Plugin: Preserve directory structure #33

julioz opened this issue Jun 4, 2020 · 0 comments · Fixed by #37
Labels
Gradle Plugin Work related to the Gradle Plugin component

Comments

@julioz
Copy link
Owner

julioz commented Jun 4, 2020

Output files stored within directories and preserve structure

  • For example, <input_dir>/com.mypackage.mydatabase/1.json should end up as <output_dir>/com.mypackage.mydatabase/1.dbml
@julioz julioz added the Gradle Plugin Work related to the Gradle Plugin component label Jun 4, 2020
@julioz julioz closed this as completed in #37 Jun 7, 2020
julioz added a commit that referenced this issue Jun 7, 2020
Fixes #33

Room's directory structure when generating DB schemas adds the database definition package name and database name to a parent directory to prevent name clashes and conflicts.

Here we move the schemas from our sample android application to respect Room's directory structure, and fix the issue that output representations are generated only on the root directory (defined by `outputLocation`) gradle property.

So, we now preserve the directory structure and mimic it when generating output files.

In other words, for a schema located in
```
$schemaLocation/com.mypackage.name.MyDatabase
```
the output files will be generated in
```
$outputLocation/com.mypackage.name.MyDatabase
```

This PR also pulls out the logic into a collaborator class to allow for unit testing of the gradle `Task` logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gradle Plugin Work related to the Gradle Plugin component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant