Skip to content

Commit

Permalink
Merge pull request #206 from eed3si9n/wip/pluginrename
Browse files Browse the repository at this point in the history
Rename plugin and publish setting
  • Loading branch information
eed3si9n committed Aug 14, 2016
2 parents 098db17 + a7284b7 commit 53d63eb
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Expand Up @@ -12,8 +12,8 @@ before_script:
- export JVM_OPTS="-Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m -XX:MaxPermSize=256m -Xss2m -Dfile.encoding=UTF-8"

after_success:
- eval "$(ssh-agent -s)" #start the ssh agent
- openssl aes-256-cbc -K $encrypted_e5f9765ae931_key -iv $encrypted_e5f9765ae931_iv -in deploy_rsa.enc -out deploy_rsa -d
- chmod 600 deploy_rsa
- ssh-add deploy_rsa
- test $TRAVIS_PULL_REQUEST == "false" && eval "$(ssh-agent -s)" #start the ssh agent
- test $TRAVIS_PULL_REQUEST == "false" && openssl aes-256-cbc -K $encrypted_e5f9765ae931_key -iv $encrypted_e5f9765ae931_iv -in deploy_rsa.enc -out deploy_rsa -d
- test $TRAVIS_PULL_REQUEST == "false" && chmod 600 deploy_rsa
- test $TRAVIS_PULL_REQUEST == "false" && ssh-add deploy_rsa
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "0.7.x" && sbt pushSiteIfChanged
15 changes: 8 additions & 7 deletions build.sbt
Expand Up @@ -4,7 +4,7 @@ val g8version = "0.6.9-SNAPSHOT"

// posterous title needs to be giter8, so both app and root are named giter8
lazy val root = (project in file(".")).
enablePlugins(TravisSitePlugin).
enablePlugins(TravisSitePlugin, NoPublish).
aggregate(app, lib, scaffold, plugin).
settings(
inThisBuild(List(
Expand All @@ -28,13 +28,11 @@ lazy val root = (project in file(".")).
)),
name := "giter8",
siteGithubRepo := "foundweekends/giter8",
siteEmail := { "eed3si9n" + "@" + "gmail.com" },
publish := (),
publishLocal := ()
siteEmail := { "eed3si9n" + "@" + "gmail.com" }
)

lazy val app = (project in file("app")).
enablePlugins(ConscriptPlugin, BuildInfoPlugin).
enablePlugins(ConscriptPlugin, BuildInfoPlugin, SonatypePublish).
dependsOn(lib).
settings(
description := "Command line tool to apply templates defined on github",
Expand All @@ -46,9 +44,10 @@ lazy val app = (project in file("app")).
)

lazy val scaffold = (project in file("scaffold")).
enablePlugins(BintrayPublish).
dependsOn(lib).
settings(
name := "giter8-scaffold",
name := "sbt-giter8-scaffold",
description := "sbt plugin for scaffolding giter8 templates",
sbtPlugin := true,
scriptedSettings,
Expand All @@ -61,9 +60,10 @@ lazy val scaffold = (project in file("scaffold")).
)

lazy val plugin = (project in file("plugin")).
enablePlugins(BintrayPublish).
dependsOn(lib).
settings(
name := "giter8-plugin",
name := "sbt-giter8",
scriptedSettings,
description := "sbt plugin for testing giter8 templates",
sbtPlugin := true,
Expand All @@ -78,6 +78,7 @@ lazy val plugin = (project in file("plugin")).
)

lazy val lib = (project in file("library")).
enablePlugins(SonatypePublish).
settings(
name := "giter8-lib",
description := "shared library for app and plugin",
Expand Down
36 changes: 33 additions & 3 deletions notes/0.7.0.markdown
@@ -1,10 +1,40 @@
### new management and Apache v2

This is the first release since the development is passed on to
[foundweekends][fw] project.

- We've relicensed Giter8 under Apache v2 license after contacting
previous contributors and getting their approvals. [#194][194]
- Organization name is changed to `org.foundweekends.giter8`.
- The sbt plugin was renamed to `sbt-giter8` and `sbt-giter8-scaffold`.
- Created Pamflet [documentation][docs].

### bug fixes and improvements

- Better error handling when templates do not compile. [#193][193] by [@njlg][@njlg]
- Support git URLs that start with `ssh://`. [#192][192] by [@njlg][@njlg]
- Fixes sbt-giter8 not expanding dynamic default properties. [#165][165] by [@sattvik][@sattvik]
- `ls(..)` properties is dropped. [#201][201] by [@eed3si9n][@eed3si9n]

### root layout

giter8 0.7.0 introduces an experimental layout called *root layout*.
When giter8 does not find `src/main/g8`, it will simply use the root directory
Giter8 0.7.0 introduces an experimental layout called *root layout*.
When Giter8 does not find `src/main/g8`, it will simply use the root directory
of the specified Git repository as the template directory.

The `default.properties` file can be placed either at the root directory
or in `project` directory.
Since you can no longer include template fields in the files
under `project` its application is very limited.
under `project` its application is very limited. [#202][202] by [@eed3si9n][@eed3si9n]

[fw]: http://www.foundweekends.org/
[docs]: http://www.foundweekends.org/giter8/
[165]: https://github.com/foundweekends/giter8/pull/165
[192]: https://github.com/foundweekends/giter8/pull/192
[193]: https://github.com/foundweekends/giter8/pull/193
[201]: https://github.com/foundweekends/giter8/pull/201
[202]: https://github.com/foundweekends/giter8/pull/202
[194]: https://github.com/foundweekends/giter8/issues/194
[@njlg]: https://github.com/njlg
[@eed3si9n]: https://github.com/eed3si9n
[@sattvik]: https://github.com/sattvik
4 changes: 2 additions & 2 deletions notes/about.markdown
@@ -1,3 +1,3 @@
[giter8][g8] is a command line tool to apply templates defined in any git repository
[Giter8][g8] is a command line tool to apply templates defined in any git repository

[g8]: http://github.com/foundweekends/giter8#readme
[g8]: http://www.foundweekends.org/giter8/
2 changes: 1 addition & 1 deletion plugin/src/sbt-test/giter8/root-layout/project/giter8.sbt
Expand Up @@ -14,4 +14,4 @@
* limitations under the License.
*/

addSbtPlugin("org.foundweekends.giter8" % "giter8-plugin" % System.getProperty("plugin.version"))
addSbtPlugin("org.foundweekends.giter8" % "sbt-giter8" % System.getProperty("plugin.version"))
2 changes: 1 addition & 1 deletion plugin/src/sbt-test/giter8/simple/project/giter8.sbt
Expand Up @@ -15,4 +15,4 @@
* limitations under the License.
*/

addSbtPlugin("org.foundweekends.giter8" % "giter8-plugin" % System.getProperty("plugin.version"))
addSbtPlugin("org.foundweekends.giter8" % "sbt-giter8" % System.getProperty("plugin.version"))
67 changes: 67 additions & 0 deletions project/Publish.scala
@@ -0,0 +1,67 @@
/*
* Originally by: Lightbend, Inc.
*
* 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.
*/

import sbt._
import sbt.Keys._
import bintray.{ BintrayKeys, BintrayPlugin }

/**
* Publish to private bintray repository.
*/
object BintrayPublish extends AutoPlugin {
override def trigger = allRequirements
override def requires = plugins.JvmPlugin && BintrayPlugin

override def buildSettings = Seq(
BintrayKeys.bintrayOrganization := Some("sbt"),
BintrayKeys.bintrayReleaseOnPublish := false
)

override def projectSettings = Seq(
BintrayKeys.bintrayRepository := "sbt-plugin-releases",
BintrayKeys.bintrayPackage := "sbt-giter8",
pomIncludeRepository := { _ => false }
)
}

/**
* Publish to private bintray repository.
*/
object SonatypePublish extends AutoPlugin {
override def requires = plugins.JvmPlugin

override def projectSettings = Seq(
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots")
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
)
}

/**
* For projects that are not published.
*/
object NoPublish extends AutoPlugin {
override def requires = plugins.JvmPlugin && BintrayPublish

override def projectSettings = Seq(
publishArtifact := false,
publish := (),
publishLocal := ()
)

}
1 change: 1 addition & 0 deletions project/bintray.sbt
@@ -0,0 +1 @@
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")
2 changes: 1 addition & 1 deletion scaffold/src/sbt-test/scaffold/simple/project/scaffold.sbt
@@ -1 +1 @@
addSbtPlugin("org.foundweekends.giter8" % "giter8-scaffold" % System.getProperty("plugin.version"))
addSbtPlugin("org.foundweekends.giter8" % "sbt-giter8-scaffold" % System.getProperty("plugin.version"))

0 comments on commit 53d63eb

Please sign in to comment.