-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Introduce extension to configure tasks based on common settings - Remove `LicenseReportTask` - Fix misspellings
- Loading branch information
1 parent
ec5f8ec
commit a441c46
Showing
7 changed files
with
100 additions
and
73 deletions.
There are no files selected for viewing
44 changes: 0 additions & 44 deletions
44
gradle-license-plugin/src/main/kotlin/com/jaredsburrows/license/BaseLicenseReportTask.kt
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
25 changes: 23 additions & 2 deletions
25
gradle-license-plugin/src/main/kotlin/com/jaredsburrows/license/project.kt
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 |
---|---|---|
@@ -1,8 +1,29 @@ | ||
package com.jaredsburrows.license | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.reporting.ReportingExtension | ||
|
||
/** Returns true if plugin exists in project */ | ||
/** Returns true if plugin exists in project. */ | ||
internal fun Project.hasPlugin(list: List<String>): Boolean { | ||
return list.find { project.plugins.hasPlugin(it) } != null | ||
return list.find { plugins.hasPlugin(it) } != null | ||
} | ||
|
||
/** Configure common configuration for both Java and Android tasks. */ | ||
internal fun Project.configureCommon(task: LicenseReportTask) { | ||
task.buildFile = buildFile | ||
|
||
// Customizing internal task options | ||
task.outputDir = extensions.getByType(ReportingExtension::class.java).file("licenses") | ||
|
||
// Customizing internal task options from extension | ||
val extension = extensions.getByType(LicenseReportExtension::class.java) | ||
task.generateCsvReport = extension.generateCsvReport | ||
task.generateHtmlReport = extension.generateHtmlReport | ||
task.generateJsonReport = extension.generateJsonReport | ||
task.generateTextReport = extension.generateTextReport | ||
task.copyCsvReportToAssets = extension.copyCsvReportToAssets | ||
task.copyHtmlReportToAssets = extension.copyHtmlReportToAssets | ||
task.copyJsonReportToAssets = extension.copyJsonReportToAssets | ||
task.copyTextReportToAssets = extension.copyTextReportToAssets | ||
task.useVariantSpecificAssetDirs = extension.useVariantSpecificAssetDirs | ||
} |
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
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