-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
LicenseDetection
public and allow choosing license style (#181)
* Set `LicenseDetection#startYear` as String so we can use other values * Allow using `LicenseDetection` publicly * Add parameter to allow changing license style in `LicenseDetection` * Create new plugin setting `headerLicenseStyle` This setting will allow automatically changing the license style when using auto-detection * Update README with latest changes
- Loading branch information
1 parent
6b0098c
commit b73aff0
Showing
9 changed files
with
60 additions
and
6 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
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
6 changes: 6 additions & 0 deletions
6
src/sbt-test/sbt-header/auto-detection-with-different-style/project/test.sbt
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,6 @@ | ||
val pluginVersion = | ||
sys.props | ||
.get("plugin.version") | ||
.getOrElse(sys.error("Sys prop plugin.version must be defined!")) | ||
|
||
addSbtPlugin("de.heikoseeberger" % "sbt-header" % pluginVersion) |
9 changes: 9 additions & 0 deletions
9
...-header/auto-detection-with-different-style/src/main/resources/HasNoHeader.scala_expected
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,9 @@ | ||
/* | ||
* Copyright 2015 Heiko Seeberger | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package de.heikoseeberger.sbtheader.test; | ||
|
||
class HasNoHeader |
3 changes: 3 additions & 0 deletions
3
src/sbt-test/sbt-header/auto-detection-with-different-style/src/main/scala/HasNoHeader.scala
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,3 @@ | ||
package de.heikoseeberger.sbtheader.test; | ||
|
||
class HasNoHeader |
5 changes: 5 additions & 0 deletions
5
src/sbt-test/sbt-header/auto-detection-with-different-style/test
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 @@ | ||
# check if headers get created with different style | ||
-> headerCheck | ||
> headerCreate | ||
$ must-mirror src/main/scala/HasNoHeader.scala src/main/resources/HasNoHeader.scala_expected | ||
> headerCheck |
5 changes: 5 additions & 0 deletions
5
src/sbt-test/sbt-header/auto-detection-with-different-style/test.sbt
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 @@ | ||
|
||
organizationName := "Heiko Seeberger" | ||
startYear := Some(2015) | ||
licenses := List(("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt"))) | ||
headerLicenseStyle := HeaderLicenseStyle.SpdxSyntax |
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