Skip to content

Commit

Permalink
Update Readme and prepare for version 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jraska committed Dec 24, 2019
1 parent 5ece967 commit 9ae8b1a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,25 @@ Gradle plugin to keep your modules graph healthy and lean.
## Assert your modules graph
<img width="1281" alt="example_graph" src="https://user-images.githubusercontent.com/6277721/70832705-18980e00-1df6-11ea-8b78-fc07ba570a2b.png">

## Configuration
## Usage
```groovy
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'gradle.plugin.modules-graph-assert:plugin:0.1.1'
}
}
apply plugin: 'com.jraska.module.graph.assertion'
```

#### Configuration
```groovy
moduleGraphAssert {
maxHeight = 4
moduleLayersFromTheTop = [":feature", ":lib", ":core"]
restrinctInLayerDependencies = [":feature", ":lib"]
restrictInLayerDependencies = [":feature", ":lib"]
}
```
2 changes: 1 addition & 1 deletion plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ gradlePlugin {
plugins {
modulesGraphAssert {
id = 'com.jraska.module.graph.assertion'
version = '0.1.0'
version = '0.1.1'
displayName = 'Modules Graph Assert'
description = 'Gradle plugin to keep your modules graph healthy and lean.'
implementationClass = 'com.jraska.module.graph.assertion.ModuleGraphAssertionsPlugin'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ object Api {
const val ASSERT_NO_IN_LAYER_PREFIX = "assertNoDependenciesWithin"
}

const val EXTENSION_ROOT = "modulesGraphAssert"
const val EXTENSION_ROOT = "moduleGraphAssert"
}

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ open class GraphRulesExtension {
var appModuleName = ":app"
var maxHeight: Int = 0
var moduleLayersFromTheTop = emptyArray<String>()
var restrinctInLayerDependencies = emptyArray<String>()
var restrictInLayerDependencies = emptyArray<String>()
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ModuleGraphAssertionsPlugin : Plugin<Project> {
}

private fun Project.addInLayerDependencyTasks(graphRules: GraphRulesExtension): List<Task> {
return graphRules.restrinctInLayerDependencies.map { layerPrefix ->
return graphRules.restrictInLayerDependencies.map { layerPrefix ->
val taskNameSuffix = layerPrefix.replace(":", "").capitalizeFirst()
val task = tasks.create("${Tasks.ASSERT_NO_IN_LAYER_PREFIX}$taskNameSuffix", AssertNoInLayerDependencies::class.java)
task.layerPrefix = layerPrefix
Expand Down

0 comments on commit 9ae8b1a

Please sign in to comment.