This repository has been archived by the owner on Apr 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script Runnable Items Enhancements (#233)
* Releasing new path version * Bumps plugin version. Upgrades scala versions * Adds some minor bug fixes * Brings the ability to provide generic runnable items * Upgrades scalaVersion at scripted tests * Bumps some library versions * Replaces scala versions literals by its val * Reapplies setting based on sbtrelease.ReleaseStateTransformations.reapply * Improves default settings for orgScriptTaskListSetting * Releases 0.4.13
- Loading branch information
1 parent
27f98cf
commit 25e5004
Showing
23 changed files
with
197 additions
and
88 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
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,34 @@ | ||
/* | ||
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package sbtorgpolicies.runnable | ||
|
||
import sbt._ | ||
|
||
case class RunnableItemConfigScope[T]( | ||
item: RunnableItem[T], | ||
allModulesScope: Boolean = false, | ||
crossScalaVersionsScope: Boolean = false) | ||
|
||
case class SetSetting[T](setting: SettingKey[T], value: T) | ||
|
||
sealed trait RunnableItem[T] | ||
|
||
case class RunnableTask[T](task: TaskKey[T]) extends RunnableItem[T] | ||
|
||
case class RunnableSetSetting[T](setSetting: SetSetting[T]) extends RunnableItem[T] | ||
|
||
case class RunnableProcess(process: String) extends RunnableItem[Unit] |
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,61 @@ | ||
/* | ||
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package sbtorgpolicies.runnable | ||
|
||
import sbt.TaskKey | ||
|
||
import scala.language.implicitConversions | ||
|
||
object syntax { | ||
|
||
implicit def runnableTaskOpsSyntax[T](taskKey: TaskKey[T]): RunnableTaskOps[T] = | ||
new RunnableTaskOps[T](taskKey) | ||
|
||
implicit def runnableSetSettingOpsSyntax[T](setSetting: SetSetting[T]): RunnableSetSettingOps[T] = | ||
new RunnableSetSettingOps[T](setSetting) | ||
|
||
final class RunnableTaskOps[T](taskKey: TaskKey[T]) { | ||
|
||
def asRunnableItem: RunnableItemConfigScope[T] = | ||
asRunnableItem(allModulesScope = false, crossScalaVersionsScope = false) | ||
|
||
def asRunnableItem(allModulesScope: Boolean, crossScalaVersionsScope: Boolean): RunnableItemConfigScope[T] = | ||
RunnableItemConfigScope(RunnableTask(taskKey), allModulesScope, crossScalaVersionsScope) | ||
|
||
} | ||
|
||
final class RunnableSetSettingOps[T](setSetting: SetSetting[T]) { | ||
|
||
def asRunnableItem: RunnableItemConfigScope[T] = | ||
asRunnableItem(allModulesScope = false, crossScalaVersionsScope = false) | ||
|
||
def asRunnableItem(allModulesScope: Boolean, crossScalaVersionsScope: Boolean): RunnableItemConfigScope[T] = | ||
RunnableItemConfigScope(RunnableSetSetting(setSetting), allModulesScope, crossScalaVersionsScope) | ||
|
||
} | ||
|
||
final class RunnableCommandOps(command: String) { | ||
|
||
def asRunnableItem: RunnableItemConfigScope[Unit] = | ||
asRunnableItem(allModulesScope = false, crossScalaVersionsScope = false) | ||
|
||
def asRunnableItem(allModulesScope: Boolean, crossScalaVersionsScope: Boolean): RunnableItemConfigScope[Unit] = | ||
RunnableItemConfigScope(RunnableProcess(command), allModulesScope, crossScalaVersionsScope) | ||
|
||
} | ||
|
||
} |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.4.10") | ||
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.4.12") | ||
libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value |
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
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
Oops, something went wrong.