Skip to content

Commit

Permalink
update to sbt 1.0, cross-publishing to 0.13/1.0, dynamic versioning, …
Browse files Browse the repository at this point in the history
…auto-publishing, documentation
  • Loading branch information
jastice committed Aug 18, 2017
1 parent 44825c2 commit 4852fc2
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 37 deletions.
35 changes: 35 additions & 0 deletions .travis.yml
@@ -0,0 +1,35 @@
language: scala

jdk:
- oraclejdk8

script:
## runs both regular tests and sbt-scripted integration tests
- sbt -Dfile.encoding=UTF8 test scripted

after_success:
- '[[ $TRAVIS_BRANCH == "master" ]] || [[ $TRAVIS_BRANCH =~ ^v[0-9.]+$ ]] && sbt "+ publish"'

sudo: false

# https://docs.travis-ci.com/user/languages/java/
addons:
apt:
packages:
- oracle-java8-installer

before_cache:
# Tricks to avoid unnecessary cache updates
- find $HOME/.sbt -name "*.lock" | xargs rm
- find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm

# These directories are cached to S3 at the end of the build
cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.sbt/boot/

env:
global:
- BINTRAY_USER=jastice
- secure: "BGRgYWxQ6lvDXteksH8vG8c2xa6rGixDJXUqVIW9W0IkzuFH1nMfMRwpniEf3T6YAhCeq6786xNavSYusR0fkSpLC4fbPRrsLfT4OhV25CdRgv/ngrRO1eKI3LgHxC0Qjjrpnn4pE1P0T/kyRMve9xqjzpvNkgCnF2d+p0p71PQ="
27 changes: 18 additions & 9 deletions README.md
Expand Up @@ -3,37 +3,46 @@
[ ![Download](https://api.bintray.com/packages/jetbrains/sbt-plugins/sbt-ide-settings/images/download.svg) ](https://bintray.com/jetbrains/sbt-plugins/sbt-ide-settings/_latestVersion)

This plugin provides several keys to be read by IDE while importing project.
SBT 0.13.5 and up.
Available for sbt 0.13.5+ and 1.0

## Usage

1. Add the following lines to `project/plugins.sbt`:

```Scala
resolvers += Resolver.url("jetbrains-bintray",
url("http://dl.bintray.com/jetbrains/sbt-plugins/"))(Resolver.ivyStylePatterns)

addSbtPlugin("org.jetbrains" % "sbt-ide-settings" % "<version>")
addSbtPlugin("org.jetbrains" % "sbt-ide-settings" % "1.0.0")
```

2. Tweak any settings you want

## Available settings

- `ideExcludedDirectories :: Seq[File]`
- `ideExcludedDirectories : Seq[File]`

List of directories to be marked as excluded in IDE.

- `ideBasePackages :: Seq[String]`
- `ideBasePackages : Seq[String]`

List of packages to be used as base prefixes for chaining. Packages starting
with one of these prefixes will be chained automatically in IDE.

- `ideSkipProject :: Boolean`
- `ideSkipProject : Boolean`

Flag indicating that current subproject should be skipped from importing.

- `ideOutputDirectory :: Option[File]`
- `ideOutputDirectory : Option[File]`

Directory to use for production and test output instead of SBT's `target`
directory.

## Using the settings without plugin

All the settings in this plugin are simply flags that are respected by IntelliJ IDEA on project import.
They can be added to a project as a setting without including this plugin in the following format:

```scala
SettingKey[Seq[File]]("ide-excluded-directories") := Seq(file("some/file"))
SettingKey[Seq[String]]("ide-base-packages") := Seq("package1", "package2")
SettingKey[Boolean]("ide-skip-project") := true
SettingKey[Option[File]]("ide-output-directory") := Option(file("some/file"))
```
26 changes: 8 additions & 18 deletions build.sbt
@@ -1,21 +1,11 @@
import bintray.Keys._
sbtPlugin := true
name := "sbt-ide-settings"
organization := "org.jetbrains"
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html"))

val commonSettings = Seq(
sbtPlugin := true,
name := "sbt-ide-settings",
organization := "org.jetbrains",
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html")),
scalaVersion := "2.10.4"
)
crossSbtVersions := Seq("0.13.16", "1.0.0")

val publishSettings = bintrayPublishSettings ++ Seq(
publishMavenStyle := false,
repository in bintray := "sbt-plugins",
bintrayOrganization in bintray := Some("jetbrains")
)
publishMavenStyle := false

val gitSettings = versionWithGit ++ Seq(
git.baseVersion := "0.0"
)

commonSettings ++ publishSettings ++ gitSettings
bintrayRepository := "sbt-plugins"
bintrayOrganization := Some("jetbrains")
2 changes: 1 addition & 1 deletion project/build.properties
@@ -1 +1 @@
sbt.version = 0.13.5
sbt.version = 1.0.0
12 changes: 3 additions & 9 deletions project/plugins.sbt
@@ -1,10 +1,4 @@
resolvers += Resolver.url(
"bintray-sbt-plugin-releases",
url("https://dl.bintray.com/content/sbt/sbt-plugin-releases"))(
Resolver.ivyStylePatterns)
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value

addSbtPlugin("me.lessis" % "bintray-sbt" % "0.1.2")

resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven"

addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.6.4")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "2.0.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1")

0 comments on commit 4852fc2

Please sign in to comment.