-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Julio Zynger
committed
Jun 4, 2020
1 parent
d042b16
commit ec565c9
Showing
6 changed files
with
139 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Contributing | ||
|
||
Thank you for your interest in contributing to FloorPlan! | ||
|
||
## Setup | ||
|
||
* Check out the [project](https://github.com/julioz/FloorPlan/) | ||
* Download [IntelliJ IDEA](https://www.jetbrains.com/idea/download/) or [Android Studio](https://developer.android.com/studio) and import it. | ||
|
||
## Build | ||
|
||
* Build the CLI and its subprojects with `./gradlew :floorplan-cli:build`. | ||
* Build the Gradle Plugin: | ||
* Publish a snapshot to your local maven repository: `./gradlew :floorplan-gradle-plugin:publishToMavenLocal` | ||
* Enable the sample app building: `echo floorplan.includeSampleApp=true >> ~/.gradle/gradle.properties` | ||
* (Optionally) Trigger the task on the sample app with `./gradlew :sample-android-project:generateFloorPlan` | ||
|
||
!!! note "Note: Gradle Plugin - workflow" | ||
The gradle plugin development workflow requires republishing of the latest builds to `mavenLocal` after each code change. You will need to the deployment steps above if you want to manually test the changes in an end-to-end fashion with the help of the sample Android application. | ||
|
||
## Tests | ||
|
||
The project is unit tested and has integration tests for its Gradle plugin. These can be run via Gradle with: | ||
``` | ||
gradlew test | ||
``` | ||
|
||
You can also run only the Gradle Plugin tests by specifying that task explicitly: | ||
|
||
``` | ||
gradlew :floorplan-gradle-plugin:test | ||
``` | ||
|
||
## Deploying the docs locally | ||
|
||
Install `mkdocs` and the required extensions: | ||
|
||
``` | ||
pip install -r requirements.txt | ||
``` | ||
|
||
Deploy it locally: | ||
|
||
``` | ||
mkdocs serve | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# FloorPlan as a Gradle Plugin | ||
|
||
### Apply the plugin | ||
|
||
Apply the gradle plugin in your root `build.gradle` file: | ||
|
||
``` | ||
buildscript { | ||
dependencies { | ||
classpath "com.zynger.floorplan:floorplan-gradle-plugin:<version>" | ||
} | ||
} | ||
``` | ||
|
||
and in the modules you want `FloorPlan`'s Gradle task to exist. | ||
|
||
For example, in an Android application module: | ||
|
||
``` | ||
plugins { | ||
id 'com.android.application' // could be library or any other module | ||
id 'com.zynger.floorplan' | ||
} | ||
``` | ||
|
||
### Gradle extension | ||
|
||
Configure FloorPlan's Gradle extension by definining a `floorPlan` block: | ||
|
||
``` | ||
floorPlan { | ||
schemaLocation = "$projectDir/schemas".toString() | ||
outputLocation = "$projectDir/floorplan-output".toString() | ||
outputFormat { | ||
svg { | ||
enabled = true | ||
} | ||
} | ||
} | ||
``` | ||
|
||
#### Output formats | ||
|
||
FloorPlan is able to output different file formats. | ||
|
||
Take a look at what a full configuration would look like, defining `DBML` as an output format (and providing [extra configurations for `DBML`](../run/#output-format)): | ||
|
||
``` | ||
floorPlan { | ||
schemaLocation = "$projectDir/schemas".toString() | ||
outputLocation = "$projectDir/floorplan-output".toString() | ||
outputFormat { | ||
dbml { | ||
enabled = true | ||
creationSqlAsTableNote = false | ||
renderNullableFields = false | ||
} | ||
svg { | ||
enabled = false | ||
} | ||
png { | ||
enabled = false | ||
} | ||
dot { | ||
enabled = false | ||
} | ||
} | ||
} | ||
``` | ||
|
||
!!! warning | ||
So far, you can only specify one output format per run, by defining which one is `enabled`. | ||
|
||
### Generate Floor Plan | ||
|
||
Once everything is setup, you can finally run FloorPlan to translate database schemas into ER diagrams. | ||
|
||
For example, to generate the diagrams associated to the `sample-android-project` module schemas, we can run: | ||
|
||
``` | ||
./gradlew :sample-android-project:generateFloorPlan | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
mkdocs | ||
mkdocs-material>=5.1.0 | ||
mkdocs-markdownextradata-plugin | ||
pymdown-extensions>=7.0 | ||
mdx_truly_sane_lists |