From d2f07be79dd9ea974b97e93ea16a2a4de6e98d2d Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 20 May 2014 12:09:19 -0400 Subject: [PATCH 01/13] Roll back Ivy to 2.3.0 for 0.13.5 --- project/Util.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Util.scala b/project/Util.scala index 810ec997e..6e8964498 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -168,7 +168,7 @@ object Common def lib(m: ModuleID) = libraryDependencies += m lazy val jlineDep = "jline" % "jline" % "2.11" lazy val jline = lib(jlineDep) - lazy val ivy = lib("org.scala-sbt.ivy" % "ivy" % "2.4.0-sbt-d6fca11d63402c92e4167cdf2da91a660d043392") + lazy val ivy = lib("org.apache.ivy" % "ivy" % "2.3.0") lazy val httpclient = lib("commons-httpclient" % "commons-httpclient" % "3.1") lazy val jsch = lib("com.jcraft" % "jsch" % "0.1.46" intransitive() ) lazy val sbinary = libraryDependencies <+= Util.nightly211(n => "org.scala-tools.sbinary" % "sbinary" % "0.4.2" cross(if(n) CrossVersion.full else CrossVersion.binary)) From 5deb103ef6441f971afbd587d486492c38723516 Mon Sep 17 00:00:00 2001 From: Dan Sanduleac Date: Tue, 20 May 2014 18:13:06 +0100 Subject: [PATCH 02/13] Fix resolving Select(ThisProject) --- main/settings/src/main/scala/sbt/Scope.scala | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/main/settings/src/main/scala/sbt/Scope.scala b/main/settings/src/main/scala/sbt/Scope.scala index c9f0211f9..d921225fd 100644 --- a/main/settings/src/main/scala/sbt/Scope.scala +++ b/main/settings/src/main/scala/sbt/Scope.scala @@ -20,10 +20,10 @@ object Scope { val GlobalScope = Scope(Global, Global, Global, Global) def resolveScope(thisScope: Scope, current: URI, rootProject: URI => String): Scope => Scope = - resolveProject(current, rootProject) compose replaceThis(thisScope) + resolveProject(current, rootProject) compose replaceThis(thisScope) compose subThisProject def resolveBuildScope(thisScope: Scope, current: URI): Scope => Scope = - buildResolve(current) compose replaceThis(thisScope) + buildResolve(current) compose replaceThis(thisScope) compose subThisProject def replaceThis(thisScope: Scope): Scope => Scope = (scope: Scope) => Scope(subThis(thisScope.project, scope.project), subThis(thisScope.config, scope.config), subThis(thisScope.task, scope.task), subThis(thisScope.extra, scope.extra)) @@ -31,6 +31,15 @@ object Scope { def subThis[T](sub: ScopeAxis[T], into: ScopeAxis[T]): ScopeAxis[T] = if (into == This) sub else into + /** + * `Select(ThisProject)` cannot be resolved by [[resolveProject]] (it doesn't know what to replace it with), so we + * perform this transformation so that [[replaceThis]] picks it up. + */ + def subThisProject: Scope => Scope = { + case s @ Scope(Select(ThisProject), _, _, _) => s.copy(project = This) + case s => s + } + def fillTaskAxis(scope: Scope, key: AttributeKey[_]): Scope = scope.task match { case _: Select[_] => scope @@ -59,7 +68,6 @@ object Scope { } def resolveProjectBuild(current: URI, ref: ProjectReference): ProjectReference = ref match { - case ThisProject => RootProject(current) case LocalRootProject => RootProject(current) case LocalProject(id) => ProjectRef(current, id) case RootProject(uri) => RootProject(resolveBuild(current, uri)) @@ -79,8 +87,8 @@ object Scope { def resolveProjectRef(current: URI, rootProject: URI => String, ref: ProjectReference): ProjectRef = ref match { - case ThisProject | LocalRootProject => ProjectRef(current, rootProject(current)) - case LocalProject(id) => ProjectRef(current, id) + case LocalRootProject => ProjectRef(current, rootProject(current)) + case LocalProject(id) => ProjectRef(current, id) case RootProject(uri) => val res = resolveBuild(current, uri); ProjectRef(res, rootProject(res)) case ProjectRef(uri, id) => ProjectRef(resolveBuild(current, uri), id) From 5273aa3a03c94ea9f8d41542c6e68bd1b5e0a314 Mon Sep 17 00:00:00 2001 From: Dan Sanduleac Date: Tue, 20 May 2014 18:19:36 +0100 Subject: [PATCH 03/13] Add scripted test to verify ThisProject is resolved properly --- sbt/src/sbt-test/project/thisProject/build.sbt | 10 ++++++++++ sbt/src/sbt-test/project/thisProject/proj2/build.sbt | 1 + sbt/src/sbt-test/project/thisProject/test | 1 + 3 files changed, 12 insertions(+) create mode 100644 sbt/src/sbt-test/project/thisProject/build.sbt create mode 100644 sbt/src/sbt-test/project/thisProject/proj2/build.sbt create mode 100644 sbt/src/sbt-test/project/thisProject/test diff --git a/sbt/src/sbt-test/project/thisProject/build.sbt b/sbt/src/sbt-test/project/thisProject/build.sbt new file mode 100644 index 000000000..6fc79c53d --- /dev/null +++ b/sbt/src/sbt-test/project/thisProject/build.sbt @@ -0,0 +1,10 @@ +val proj2 = project + +name := "proj1" + +val check = taskKey[Unit]("Ensure each project is named appropriately") + +check := { + require(name.value == "proj1") + require((name in proj2).value == "boo") +} diff --git a/sbt/src/sbt-test/project/thisProject/proj2/build.sbt b/sbt/src/sbt-test/project/thisProject/proj2/build.sbt new file mode 100644 index 000000000..7f48be956 --- /dev/null +++ b/sbt/src/sbt-test/project/thisProject/proj2/build.sbt @@ -0,0 +1 @@ +name in ThisProject := "boo" diff --git a/sbt/src/sbt-test/project/thisProject/test b/sbt/src/sbt-test/project/thisProject/test new file mode 100644 index 000000000..15675b169 --- /dev/null +++ b/sbt/src/sbt-test/project/thisProject/test @@ -0,0 +1 @@ +> check From 0f54be9c967c5f36bf7ba15e629add33e9d2b3b9 Mon Sep 17 00:00:00 2001 From: ZhiFeng Hu Date: Wed, 21 May 2014 10:41:23 +0800 Subject: [PATCH 04/13] JDK8 compat issue, MaxPermSize removed since JDK 8 --- src/sphinx/Detailed-Topics/Setup-Notes.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/sphinx/Detailed-Topics/Setup-Notes.rst b/src/sphinx/Detailed-Topics/Setup-Notes.rst index ca7fd3ec0..186a36025 100644 --- a/src/sphinx/Detailed-Topics/Setup-Notes.rst +++ b/src/sphinx/Detailed-Topics/Setup-Notes.rst @@ -4,6 +4,18 @@ Setup Notes Some notes on how to set up your `sbt` script. + +JDK8 compat issue +--------------------- + +Since JDK 8 , The MaxPemSize not supported anymore. + +You should remove -XX:MaxPermSize=???m from JAVA_OPTS + +The sbt default configure file locate at /usr/share/sbt-launcher-packaging/bin/sbt-launch-lib.bash + +You may modify it by hand if you want + Do not put `sbt-launch.jar` on your classpath. ------------------------------------------------ From 73e8676ea5c855d5d0ddba95e087a660c26bd6ad Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Tue, 27 May 2014 09:35:32 -0400 Subject: [PATCH 05/13] 0.13.5 release. --- project/Sbt.scala | 2 +- src/main/conscript/sbt/launchconfig | 3 +-- src/main/conscript/scalas/launchconfig | 3 +-- src/main/conscript/screpl/launchconfig | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/project/Sbt.scala b/project/Sbt.scala index 537d4881d..b6c835678 100644 --- a/project/Sbt.scala +++ b/project/Sbt.scala @@ -14,7 +14,7 @@ object Sbt extends Build override lazy val settings = super.settings ++ buildSettings ++ Status.settings ++ nightlySettings def buildSettings = Seq( organization := "org.scala-sbt", - version := "0.13.5-SNAPSHOT", + version := "0.13.5", publishArtifact in packageDoc := false, scalaVersion := "2.10.4", publishMavenStyle := false, diff --git a/src/main/conscript/sbt/launchconfig b/src/main/conscript/sbt/launchconfig index ff85bfccf..e960ad8f9 100644 --- a/src/main/conscript/sbt/launchconfig +++ b/src/main/conscript/sbt/launchconfig @@ -4,7 +4,7 @@ [app] org: ${sbt.organization-org.scala-sbt} name: sbt - version: ${sbt.version-read(sbt.version)[0.13.5-SNAPSHOT]} + version: ${sbt.version-read(sbt.version)[0.13.5]} class: sbt.xMain components: xsbti,extra cross-versioned: ${sbt.cross.versioned-false} @@ -13,7 +13,6 @@ [repositories] local typesafe-ivy-releases: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly - typesafe-ivy-snapshots: http://repo.typesafe.com/typesafe/ivy-snapshots/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly maven-central [boot] diff --git a/src/main/conscript/scalas/launchconfig b/src/main/conscript/scalas/launchconfig index 91882ac37..e1f7487f8 100644 --- a/src/main/conscript/scalas/launchconfig +++ b/src/main/conscript/scalas/launchconfig @@ -4,7 +4,7 @@ [app] org: ${sbt.organization-org.scala-sbt} name: sbt - version: ${sbt.version-read(sbt.version)[0.13.5-SNAPSHOT]} + version: ${sbt.version-read(sbt.version)[0.13.5]} class: sbt.ScriptMain components: xsbti,extra cross-versioned: ${sbt.cross.versioned-false} @@ -13,7 +13,6 @@ [repositories] local typesafe-ivy-releases: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly - typesafe-ivy-snapshots: http://repo.typesafe.com/typesafe/ivy-snapshots/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly maven-central [boot] diff --git a/src/main/conscript/screpl/launchconfig b/src/main/conscript/screpl/launchconfig index b4bbf8354..92d19c97c 100644 --- a/src/main/conscript/screpl/launchconfig +++ b/src/main/conscript/screpl/launchconfig @@ -4,7 +4,7 @@ [app] org: ${sbt.organization-org.scala-sbt} name: sbt - version: ${sbt.version-read(sbt.version)[0.13.5-SNAPSHOT]} + version: ${sbt.version-read(sbt.version)[0.13.5]} class: sbt.ConsoleMain components: xsbti,extra cross-versioned: ${sbt.cross.versioned-false} @@ -13,7 +13,6 @@ [repositories] local typesafe-ivy-releases: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly - typesafe-ivy-snapshots: http://repo.typesafe.com/typesafe/ivy-snapshots/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly maven-central [boot] From b69a273f37053e0581b921f082f0b7a72ebb6e94 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Wed, 28 May 2014 08:55:29 -0400 Subject: [PATCH 06/13] Fix import issues to generate sxr/scaladoc. --- ivy/src/main/scala/sbt/ConvertResolver.scala | 17 +++++------ ivy/src/main/scala/sbt/CustomPomParser.scala | 17 +++++------ ivy/src/main/scala/sbt/CustomXmlParser.scala | 11 ++++--- ivy/src/main/scala/sbt/Ivy.scala | 30 +++++++++---------- ivy/src/main/scala/sbt/IvyActions.scala | 16 +++++----- ivy/src/main/scala/sbt/IvyCache.scala | 13 ++++---- ivy/src/main/scala/sbt/IvyScala.scala | 9 +++--- ivy/src/main/scala/sbt/MakePom.scala | 8 ++--- ivy/src/main/scala/sbt/ProjectResolver.scala | 7 ++--- .../scala/sbt/JUnitXmlTestsListener.scala | 4 +-- 10 files changed, 63 insertions(+), 69 deletions(-) diff --git a/ivy/src/main/scala/sbt/ConvertResolver.scala b/ivy/src/main/scala/sbt/ConvertResolver.scala index 74c5c119c..b09c168e4 100644 --- a/ivy/src/main/scala/sbt/ConvertResolver.scala +++ b/ivy/src/main/scala/sbt/ConvertResolver.scala @@ -5,15 +5,14 @@ package sbt import java.net.URL import java.util.Collections -import org.apache.ivy.{core,plugins} -import core.module.id.ModuleRevisionId -import core.module.descriptor.DependencyDescriptor -import core.resolve.ResolveData -import core.settings.IvySettings -import plugins.resolver.{BasicResolver, DependencyResolver, IBiblioResolver, RepositoryResolver} -import plugins.resolver.{AbstractPatternsBasedResolver, AbstractSshBasedResolver, FileSystemResolver, SFTPResolver, SshResolver, URLResolver} -import plugins.repository.url.{URLRepository => URLRepo} -import plugins.repository.file.{FileRepository => FileRepo, FileResource} +import org.apache.ivy.core.module.id.ModuleRevisionId +import org.apache.ivy.core.module.descriptor.DependencyDescriptor +import org.apache.ivy.core.resolve.ResolveData +import org.apache.ivy.core.settings.IvySettings +import org.apache.ivy.plugins.resolver.{BasicResolver, DependencyResolver, IBiblioResolver, RepositoryResolver} +import org.apache.ivy.plugins.resolver.{AbstractPatternsBasedResolver, AbstractSshBasedResolver, FileSystemResolver, SFTPResolver, SshResolver, URLResolver} +import org.apache.ivy.plugins.repository.url.{URLRepository => URLRepo} +import org.apache.ivy.plugins.repository.file.{FileRepository => FileRepo, FileResource} import java.io.File import org.apache.ivy.util.ChecksumHelper import org.apache.ivy.core.module.descriptor.{Artifact=>IArtifact} diff --git a/ivy/src/main/scala/sbt/CustomPomParser.scala b/ivy/src/main/scala/sbt/CustomPomParser.scala index 871c1f07c..0f7f6c315 100644 --- a/ivy/src/main/scala/sbt/CustomPomParser.scala +++ b/ivy/src/main/scala/sbt/CustomPomParser.scala @@ -1,14 +1,13 @@ package sbt - import org.apache.ivy.{core, plugins, util} - import core.module.id.ModuleRevisionId - import core.module.descriptor.{DefaultArtifact, DefaultExtendsDescriptor, DefaultModuleDescriptor, ModuleDescriptor} - import core.module.descriptor.{DefaultDependencyDescriptor, DependencyDescriptor} - import plugins.parser.{m2, ModuleDescriptorParser, ModuleDescriptorParserRegistry, ParserSettings} - import m2.{PomModuleDescriptorBuilder, PomModuleDescriptorParser} - import plugins.repository.Resource - import plugins.namespace.NamespaceTransformer - import util.extendable.ExtendableItem + import org.apache.ivy.core.module.id.ModuleRevisionId + import org.apache.ivy.core.module.descriptor.{DefaultArtifact, DefaultExtendsDescriptor, DefaultModuleDescriptor, ModuleDescriptor} + import org.apache.ivy.core.module.descriptor.{DefaultDependencyDescriptor, DependencyDescriptor} + import org.apache.ivy.plugins.parser.{ModuleDescriptorParser, ModuleDescriptorParserRegistry, ParserSettings} + import org.apache.ivy.plugins.parser.m2.{PomModuleDescriptorBuilder, PomModuleDescriptorParser} + import org.apache.ivy.plugins.repository.Resource + import org.apache.ivy.plugins.namespace.NamespaceTransformer + import org.apache.ivy.util.extendable.ExtendableItem import java.io.{File, InputStream} import java.net.URL diff --git a/ivy/src/main/scala/sbt/CustomXmlParser.scala b/ivy/src/main/scala/sbt/CustomXmlParser.scala index da44743f6..1264a5231 100644 --- a/ivy/src/main/scala/sbt/CustomXmlParser.scala +++ b/ivy/src/main/scala/sbt/CustomXmlParser.scala @@ -6,12 +6,11 @@ package sbt import java.io.ByteArrayInputStream import java.net.URL -import org.apache.ivy.{core, plugins} -import core.module.descriptor.{DefaultDependencyDescriptor, DefaultModuleDescriptor} -import core.settings.IvySettings -import plugins.parser.xml.XmlModuleDescriptorParser -import plugins.repository.Resource -import plugins.repository.url.URLResource +import org.apache.ivy.core.module.descriptor.{DefaultDependencyDescriptor, DefaultModuleDescriptor} +import org.apache.ivy.core.settings.IvySettings +import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser +import org.apache.ivy.plugins.repository.Resource +import org.apache.ivy.plugins.repository.url.URLResource /** Subclasses the default Ivy file parser in order to provide access to protected methods.*/ private[sbt] object CustomXmlParser extends XmlModuleDescriptorParser diff --git a/ivy/src/main/scala/sbt/Ivy.scala b/ivy/src/main/scala/sbt/Ivy.scala index a6519c6bc..301dfa51d 100644 --- a/ivy/src/main/scala/sbt/Ivy.scala +++ b/ivy/src/main/scala/sbt/Ivy.scala @@ -11,21 +11,21 @@ import java.util.concurrent.Callable import java.util.{Collection, Collections => CS} import CS.singleton -import org.apache.ivy.{core, plugins, util, Ivy} -import core.{IvyPatternHelper, LogOptions} -import core.cache.{CacheMetadataOptions, DefaultRepositoryCacheManager, ModuleDescriptorWriter} -import core.module.descriptor.{Artifact => IArtifact, DefaultArtifact, DefaultDependencyArtifactDescriptor, MDArtifact} -import core.module.descriptor.{DefaultDependencyDescriptor, DefaultModuleDescriptor, DependencyDescriptor, ModuleDescriptor, License} -import core.module.descriptor.{OverrideDependencyDescriptorMediator} -import core.module.id.{ArtifactId,ModuleId, ModuleRevisionId} -import core.resolve.{IvyNode, ResolveData, ResolvedModuleRevision} -import core.settings.IvySettings -import plugins.latest.LatestRevisionStrategy -import plugins.matcher.PatternMatcher -import plugins.parser.m2.PomModuleDescriptorParser -import plugins.resolver.{ChainResolver, DependencyResolver} -import util.{Message, MessageLogger} -import util.extendable.ExtendableItem +import org.apache.ivy.Ivy +import org.apache.ivy.core.{IvyPatternHelper, LogOptions} +import org.apache.ivy.core.cache.{CacheMetadataOptions, DefaultRepositoryCacheManager, ModuleDescriptorWriter} +import org.apache.ivy.core.module.descriptor.{Artifact => IArtifact, DefaultArtifact, DefaultDependencyArtifactDescriptor, MDArtifact} +import org.apache.ivy.core.module.descriptor.{DefaultDependencyDescriptor, DefaultModuleDescriptor, DependencyDescriptor, ModuleDescriptor, License} +import org.apache.ivy.core.module.descriptor.{OverrideDependencyDescriptorMediator} +import org.apache.ivy.core.module.id.{ArtifactId,ModuleId, ModuleRevisionId} +import org.apache.ivy.core.resolve.{IvyNode, ResolveData, ResolvedModuleRevision} +import org.apache.ivy.core.settings.IvySettings +import org.apache.ivy.plugins.latest.LatestRevisionStrategy +import org.apache.ivy.plugins.matcher.PatternMatcher +import org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser +import org.apache.ivy.plugins.resolver.{ChainResolver, DependencyResolver} +import org.apache.ivy.util.{Message, MessageLogger} +import org.apache.ivy.util.extendable.ExtendableItem import scala.xml.{NodeSeq, Text} diff --git a/ivy/src/main/scala/sbt/IvyActions.scala b/ivy/src/main/scala/sbt/IvyActions.scala index 716579e0f..4523fe9ff 100644 --- a/ivy/src/main/scala/sbt/IvyActions.scala +++ b/ivy/src/main/scala/sbt/IvyActions.scala @@ -6,14 +6,14 @@ package sbt import java.io.File import scala.xml.{Node => XNode, NodeSeq} -import org.apache.ivy.{core, plugins, Ivy} -import core.{IvyPatternHelper, LogOptions} -import core.deliver.DeliverOptions -import core.install.InstallOptions -import core.module.descriptor.{Artifact => IArtifact, MDArtifact, ModuleDescriptor, DefaultModuleDescriptor} -import core.report.ResolveReport -import core.resolve.ResolveOptions -import plugins.resolver.{BasicResolver, DependencyResolver} +import org.apache.ivy.Ivy +import org.apache.ivy.core.{IvyPatternHelper, LogOptions} +import org.apache.ivy.core.deliver.DeliverOptions +import org.apache.ivy.core.install.InstallOptions +import org.apache.ivy.core.module.descriptor.{Artifact => IArtifact, MDArtifact, ModuleDescriptor, DefaultModuleDescriptor} +import org.apache.ivy.core.report.ResolveReport +import org.apache.ivy.core.resolve.ResolveOptions +import org.apache.ivy.plugins.resolver.{BasicResolver, DependencyResolver} final class DeliverConfiguration(val deliverIvyPattern: String, val status: String, val configurations: Option[Seq[Configuration]], val logging: UpdateLogging.Value) final class PublishConfiguration(val ivyFile: Option[File], val resolverName: String, val artifacts: Map[Artifact, File], val checksums: Seq[String], val logging: UpdateLogging.Value, diff --git a/ivy/src/main/scala/sbt/IvyCache.scala b/ivy/src/main/scala/sbt/IvyCache.scala index 3ff8432f0..f7a5dbe2e 100644 --- a/ivy/src/main/scala/sbt/IvyCache.scala +++ b/ivy/src/main/scala/sbt/IvyCache.scala @@ -6,13 +6,12 @@ package sbt import java.io.File import java.net.URL -import org.apache.ivy.{core, plugins, util} -import core.cache.{ArtifactOrigin, CacheDownloadOptions, DefaultRepositoryCacheManager} -import core.module.descriptor.{Artifact => IvyArtifact, DefaultArtifact} -import plugins.repository.file.{FileRepository=>IvyFileRepository, FileResource} -import plugins.repository.{ArtifactResourceResolver, Resource, ResourceDownloader} -import plugins.resolver.util.ResolvedResource -import util.FileUtil +import org.apache.ivy.core.cache.{ArtifactOrigin, CacheDownloadOptions, DefaultRepositoryCacheManager} +import org.apache.ivy.core.module.descriptor.{Artifact => IvyArtifact, DefaultArtifact} +import org.apache.ivy.plugins.repository.file.{FileRepository=>IvyFileRepository, FileResource} +import org.apache.ivy.plugins.repository.{ArtifactResourceResolver, Resource, ResourceDownloader} +import org.apache.ivy.plugins.resolver.util.ResolvedResource +import org.apache.ivy.util.FileUtil class NotInCache(val id: ModuleID, cause: Throwable) extends RuntimeException(NotInCache(id, cause), cause) diff --git a/ivy/src/main/scala/sbt/IvyScala.scala b/ivy/src/main/scala/sbt/IvyScala.scala index 23b7597ff..fd442c86f 100644 --- a/ivy/src/main/scala/sbt/IvyScala.scala +++ b/ivy/src/main/scala/sbt/IvyScala.scala @@ -6,11 +6,10 @@ package sbt import java.util.Collections.emptyMap import scala.collection.mutable.HashSet -import org.apache.ivy.{core, plugins} -import core.module.descriptor.{DefaultExcludeRule, ExcludeRule} -import core.module.descriptor.{DependencyDescriptor, DefaultModuleDescriptor, ModuleDescriptor, OverrideDependencyDescriptorMediator} -import core.module.id.{ArtifactId,ModuleId, ModuleRevisionId} -import plugins.matcher.ExactPatternMatcher +import org.apache.ivy.core.module.descriptor.{DefaultExcludeRule, ExcludeRule} +import org.apache.ivy.core.module.descriptor.{DependencyDescriptor, DefaultModuleDescriptor, ModuleDescriptor, OverrideDependencyDescriptorMediator} +import org.apache.ivy.core.module.id.{ArtifactId,ModuleId, ModuleRevisionId} +import org.apache.ivy.plugins.matcher.ExactPatternMatcher object ScalaArtifacts { diff --git a/ivy/src/main/scala/sbt/MakePom.scala b/ivy/src/main/scala/sbt/MakePom.scala index 16ec28333..22ca8a524 100644 --- a/ivy/src/main/scala/sbt/MakePom.scala +++ b/ivy/src/main/scala/sbt/MakePom.scala @@ -13,10 +13,10 @@ import java.io.File import scala.xml.{Elem, Node => XNode, NodeSeq, PrettyPrinter, PrefixedAttribute} import Configurations.Optional -import org.apache.ivy.{core, plugins, Ivy} -import core.settings.IvySettings -import core.module.descriptor.{DependencyArtifactDescriptor, DependencyDescriptor, License, ModuleDescriptor, ExcludeRule} -import plugins.resolver.{ChainResolver, DependencyResolver, IBiblioResolver} +import org.apache.ivy.Ivy +import org.apache.ivy.core.settings.IvySettings +import org.apache.ivy.core.module.descriptor.{DependencyArtifactDescriptor, DependencyDescriptor, License, ModuleDescriptor, ExcludeRule} +import org.apache.ivy.plugins.resolver.{ChainResolver, DependencyResolver, IBiblioResolver} class MakePom(val log: Logger) { diff --git a/ivy/src/main/scala/sbt/ProjectResolver.scala b/ivy/src/main/scala/sbt/ProjectResolver.scala index 917889db8..e0abaeab1 100644 --- a/ivy/src/main/scala/sbt/ProjectResolver.scala +++ b/ivy/src/main/scala/sbt/ProjectResolver.scala @@ -6,14 +6,13 @@ package sbt import java.io.File import java.util.Date - import org.apache.ivy.{core,plugins} - import core.{cache,module, report, resolve,search} + import org.apache.ivy.core.{cache,module, report, resolve,search} import cache.{ArtifactOrigin,RepositoryCacheManager} import search.{ModuleEntry, OrganisationEntry, RevisionEntry} import module.id.ModuleRevisionId import module.descriptor.{Artifact => IArtifact, DefaultArtifact, DependencyDescriptor, ModuleDescriptor} - import plugins.namespace.Namespace - import plugins.resolver.{DependencyResolver,ResolverSettings} + import org.apache.ivy.plugins.namespace.Namespace + import org.apache.ivy.plugins.resolver.{DependencyResolver,ResolverSettings} import report.{ArtifactDownloadReport, DownloadReport, DownloadStatus, MetadataArtifactDownloadReport} import resolve.{DownloadOptions, ResolveData, ResolvedModuleRevision} diff --git a/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala b/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala index f3a0bdae6..d950a4932 100644 --- a/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala +++ b/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala @@ -4,7 +4,7 @@ import java.io.{StringWriter, PrintWriter, File} import java.net.InetAddress import scala.collection.mutable.ListBuffer import scala.util.DynamicVariable -import scala.xml.{Elem, Node, XML} +import scala.xml.{Elem, Node=>XNode, XML} import testing.{Event => TEvent, Status => TStatus, OptionalThrowable, TestSelector} /** @@ -23,7 +23,7 @@ class JUnitXmlTestsListener(val outputDir:String) extends TestsListener val properties = { val iter = System.getProperties.entrySet.iterator - val props:ListBuffer[Node] = new ListBuffer() + val props:ListBuffer[XNode] = new ListBuffer() while (iter.hasNext) { val next = iter.next props += From 4c2d88649e96e4e55b3f52b77f2bb763e8d0a6ba Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Wed, 28 May 2014 09:12:55 -0400 Subject: [PATCH 07/13] Fix formatting issues and bump to sbt 0.13.5 --- ivy/src/main/scala/sbt/ConvertResolver.scala | 8 ++--- ivy/src/main/scala/sbt/CustomPomParser.scala | 16 +++++----- ivy/src/main/scala/sbt/CustomXmlParser.scala | 2 +- ivy/src/main/scala/sbt/Ivy.scala | 18 +++++------ ivy/src/main/scala/sbt/IvyActions.scala | 6 ++-- ivy/src/main/scala/sbt/IvyCache.scala | 8 ++--- ivy/src/main/scala/sbt/IvyScala.scala | 6 ++-- ivy/src/main/scala/sbt/MakePom.scala | 4 +-- ivy/src/main/scala/sbt/ProjectResolver.scala | 6 ++-- project/Sbt.scala | 30 +++++++++---------- project/Util.scala | 6 ++-- project/build.properties | 2 +- .../scala/sbt/JUnitXmlTestsListener.scala | 4 +-- 13 files changed, 58 insertions(+), 58 deletions(-) diff --git a/ivy/src/main/scala/sbt/ConvertResolver.scala b/ivy/src/main/scala/sbt/ConvertResolver.scala index d060322d9..a36d7430c 100644 --- a/ivy/src/main/scala/sbt/ConvertResolver.scala +++ b/ivy/src/main/scala/sbt/ConvertResolver.scala @@ -9,10 +9,10 @@ import org.apache.ivy.core.module.id.ModuleRevisionId import org.apache.ivy.core.module.descriptor.DependencyDescriptor import org.apache.ivy.core.resolve.ResolveData import org.apache.ivy.core.settings.IvySettings -import org.apache.ivy.plugins.resolver.{BasicResolver, DependencyResolver, IBiblioResolver, RepositoryResolver} -import org.apache.ivy.plugins.resolver.{AbstractPatternsBasedResolver, AbstractSshBasedResolver, FileSystemResolver, SFTPResolver, SshResolver, URLResolver} -import org.apache.ivy.plugins.repository.url.{URLRepository => URLRepo} -import org.apache.ivy.plugins.repository.file.{FileRepository => FileRepo, FileResource} +import org.apache.ivy.plugins.resolver.{ BasicResolver, DependencyResolver, IBiblioResolver, RepositoryResolver } +import org.apache.ivy.plugins.resolver.{ AbstractPatternsBasedResolver, AbstractSshBasedResolver, FileSystemResolver, SFTPResolver, SshResolver, URLResolver } +import org.apache.ivy.plugins.repository.url.{ URLRepository => URLRepo } +import org.apache.ivy.plugins.repository.file.{ FileRepository => FileRepo, FileResource } import java.io.File import org.apache.ivy.util.ChecksumHelper import org.apache.ivy.core.module.descriptor.{ Artifact => IArtifact } diff --git a/ivy/src/main/scala/sbt/CustomPomParser.scala b/ivy/src/main/scala/sbt/CustomPomParser.scala index 6e186695c..5e0deb7c4 100644 --- a/ivy/src/main/scala/sbt/CustomPomParser.scala +++ b/ivy/src/main/scala/sbt/CustomPomParser.scala @@ -1,13 +1,13 @@ package sbt - import org.apache.ivy.core.module.id.ModuleRevisionId - import org.apache.ivy.core.module.descriptor.{DefaultArtifact, DefaultExtendsDescriptor, DefaultModuleDescriptor, ModuleDescriptor} - import org.apache.ivy.core.module.descriptor.{DefaultDependencyDescriptor, DependencyDescriptor} - import org.apache.ivy.plugins.parser.{ModuleDescriptorParser, ModuleDescriptorParserRegistry, ParserSettings} - import org.apache.ivy.plugins.parser.m2.{PomModuleDescriptorBuilder, PomModuleDescriptorParser} - import org.apache.ivy.plugins.repository.Resource - import org.apache.ivy.plugins.namespace.NamespaceTransformer - import org.apache.ivy.util.extendable.ExtendableItem +import org.apache.ivy.core.module.id.ModuleRevisionId +import org.apache.ivy.core.module.descriptor.{ DefaultArtifact, DefaultExtendsDescriptor, DefaultModuleDescriptor, ModuleDescriptor } +import org.apache.ivy.core.module.descriptor.{ DefaultDependencyDescriptor, DependencyDescriptor } +import org.apache.ivy.plugins.parser.{ ModuleDescriptorParser, ModuleDescriptorParserRegistry, ParserSettings } +import org.apache.ivy.plugins.parser.m2.{ PomModuleDescriptorBuilder, PomModuleDescriptorParser } +import org.apache.ivy.plugins.repository.Resource +import org.apache.ivy.plugins.namespace.NamespaceTransformer +import org.apache.ivy.util.extendable.ExtendableItem import java.io.{ File, InputStream } import java.net.URL diff --git a/ivy/src/main/scala/sbt/CustomXmlParser.scala b/ivy/src/main/scala/sbt/CustomXmlParser.scala index 684caa3ac..c5462070c 100644 --- a/ivy/src/main/scala/sbt/CustomXmlParser.scala +++ b/ivy/src/main/scala/sbt/CustomXmlParser.scala @@ -6,7 +6,7 @@ package sbt import java.io.ByteArrayInputStream import java.net.URL -import org.apache.ivy.core.module.descriptor.{DefaultDependencyDescriptor, DefaultModuleDescriptor} +import org.apache.ivy.core.module.descriptor.{ DefaultDependencyDescriptor, DefaultModuleDescriptor } import org.apache.ivy.core.settings.IvySettings import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser import org.apache.ivy.plugins.repository.Resource diff --git a/ivy/src/main/scala/sbt/Ivy.scala b/ivy/src/main/scala/sbt/Ivy.scala index 441e442d4..7f54fb4b4 100644 --- a/ivy/src/main/scala/sbt/Ivy.scala +++ b/ivy/src/main/scala/sbt/Ivy.scala @@ -12,19 +12,19 @@ import java.util.{ Collection, Collections => CS } import CS.singleton import org.apache.ivy.Ivy -import org.apache.ivy.core.{IvyPatternHelper, LogOptions} -import org.apache.ivy.core.cache.{CacheMetadataOptions, DefaultRepositoryCacheManager, ModuleDescriptorWriter} -import org.apache.ivy.core.module.descriptor.{Artifact => IArtifact, DefaultArtifact, DefaultDependencyArtifactDescriptor, MDArtifact} -import org.apache.ivy.core.module.descriptor.{DefaultDependencyDescriptor, DefaultModuleDescriptor, DependencyDescriptor, ModuleDescriptor, License} -import org.apache.ivy.core.module.descriptor.{OverrideDependencyDescriptorMediator} -import org.apache.ivy.core.module.id.{ArtifactId,ModuleId, ModuleRevisionId} -import org.apache.ivy.core.resolve.{IvyNode, ResolveData, ResolvedModuleRevision} +import org.apache.ivy.core.{ IvyPatternHelper, LogOptions } +import org.apache.ivy.core.cache.{ CacheMetadataOptions, DefaultRepositoryCacheManager, ModuleDescriptorWriter } +import org.apache.ivy.core.module.descriptor.{ Artifact => IArtifact, DefaultArtifact, DefaultDependencyArtifactDescriptor, MDArtifact } +import org.apache.ivy.core.module.descriptor.{ DefaultDependencyDescriptor, DefaultModuleDescriptor, DependencyDescriptor, ModuleDescriptor, License } +import org.apache.ivy.core.module.descriptor.{ OverrideDependencyDescriptorMediator } +import org.apache.ivy.core.module.id.{ ArtifactId, ModuleId, ModuleRevisionId } +import org.apache.ivy.core.resolve.{ IvyNode, ResolveData, ResolvedModuleRevision } import org.apache.ivy.core.settings.IvySettings import org.apache.ivy.plugins.latest.LatestRevisionStrategy import org.apache.ivy.plugins.matcher.PatternMatcher import org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser -import org.apache.ivy.plugins.resolver.{ChainResolver, DependencyResolver} -import org.apache.ivy.util.{Message, MessageLogger} +import org.apache.ivy.plugins.resolver.{ ChainResolver, DependencyResolver } +import org.apache.ivy.util.{ Message, MessageLogger } import org.apache.ivy.util.extendable.ExtendableItem import scala.xml.{ NodeSeq, Text } diff --git a/ivy/src/main/scala/sbt/IvyActions.scala b/ivy/src/main/scala/sbt/IvyActions.scala index 039c2b86e..c87666373 100644 --- a/ivy/src/main/scala/sbt/IvyActions.scala +++ b/ivy/src/main/scala/sbt/IvyActions.scala @@ -7,13 +7,13 @@ import java.io.File import scala.xml.{ Node => XNode, NodeSeq } import org.apache.ivy.Ivy -import org.apache.ivy.core.{IvyPatternHelper, LogOptions} +import org.apache.ivy.core.{ IvyPatternHelper, LogOptions } import org.apache.ivy.core.deliver.DeliverOptions import org.apache.ivy.core.install.InstallOptions -import org.apache.ivy.core.module.descriptor.{Artifact => IArtifact, MDArtifact, ModuleDescriptor, DefaultModuleDescriptor} +import org.apache.ivy.core.module.descriptor.{ Artifact => IArtifact, MDArtifact, ModuleDescriptor, DefaultModuleDescriptor } import org.apache.ivy.core.report.ResolveReport import org.apache.ivy.core.resolve.ResolveOptions -import org.apache.ivy.plugins.resolver.{BasicResolver, DependencyResolver} +import org.apache.ivy.plugins.resolver.{ BasicResolver, DependencyResolver } final class DeliverConfiguration(val deliverIvyPattern: String, val status: String, val configurations: Option[Seq[Configuration]], val logging: UpdateLogging.Value) final class PublishConfiguration(val ivyFile: Option[File], val resolverName: String, val artifacts: Map[Artifact, File], val checksums: Seq[String], val logging: UpdateLogging.Value, diff --git a/ivy/src/main/scala/sbt/IvyCache.scala b/ivy/src/main/scala/sbt/IvyCache.scala index 4448bf053..51e02b60c 100644 --- a/ivy/src/main/scala/sbt/IvyCache.scala +++ b/ivy/src/main/scala/sbt/IvyCache.scala @@ -6,10 +6,10 @@ package sbt import java.io.File import java.net.URL -import org.apache.ivy.core.cache.{ArtifactOrigin, CacheDownloadOptions, DefaultRepositoryCacheManager} -import org.apache.ivy.core.module.descriptor.{Artifact => IvyArtifact, DefaultArtifact} -import org.apache.ivy.plugins.repository.file.{FileRepository=>IvyFileRepository, FileResource} -import org.apache.ivy.plugins.repository.{ArtifactResourceResolver, Resource, ResourceDownloader} +import org.apache.ivy.core.cache.{ ArtifactOrigin, CacheDownloadOptions, DefaultRepositoryCacheManager } +import org.apache.ivy.core.module.descriptor.{ Artifact => IvyArtifact, DefaultArtifact } +import org.apache.ivy.plugins.repository.file.{ FileRepository => IvyFileRepository, FileResource } +import org.apache.ivy.plugins.repository.{ ArtifactResourceResolver, Resource, ResourceDownloader } import org.apache.ivy.plugins.resolver.util.ResolvedResource import org.apache.ivy.util.FileUtil diff --git a/ivy/src/main/scala/sbt/IvyScala.scala b/ivy/src/main/scala/sbt/IvyScala.scala index 1ae99c2b0..e2468a81a 100644 --- a/ivy/src/main/scala/sbt/IvyScala.scala +++ b/ivy/src/main/scala/sbt/IvyScala.scala @@ -6,9 +6,9 @@ package sbt import java.util.Collections.emptyMap import scala.collection.mutable.HashSet -import org.apache.ivy.core.module.descriptor.{DefaultExcludeRule, ExcludeRule} -import org.apache.ivy.core.module.descriptor.{DependencyDescriptor, DefaultModuleDescriptor, ModuleDescriptor, OverrideDependencyDescriptorMediator} -import org.apache.ivy.core.module.id.{ArtifactId,ModuleId, ModuleRevisionId} +import org.apache.ivy.core.module.descriptor.{ DefaultExcludeRule, ExcludeRule } +import org.apache.ivy.core.module.descriptor.{ DependencyDescriptor, DefaultModuleDescriptor, ModuleDescriptor, OverrideDependencyDescriptorMediator } +import org.apache.ivy.core.module.id.{ ArtifactId, ModuleId, ModuleRevisionId } import org.apache.ivy.plugins.matcher.ExactPatternMatcher object ScalaArtifacts { diff --git a/ivy/src/main/scala/sbt/MakePom.scala b/ivy/src/main/scala/sbt/MakePom.scala index 7e185d12a..be3baba63 100644 --- a/ivy/src/main/scala/sbt/MakePom.scala +++ b/ivy/src/main/scala/sbt/MakePom.scala @@ -15,8 +15,8 @@ import Configurations.Optional import org.apache.ivy.Ivy import org.apache.ivy.core.settings.IvySettings -import org.apache.ivy.core.module.descriptor.{DependencyArtifactDescriptor, DependencyDescriptor, License, ModuleDescriptor, ExcludeRule} -import org.apache.ivy.plugins.resolver.{ChainResolver, DependencyResolver, IBiblioResolver} +import org.apache.ivy.core.module.descriptor.{ DependencyArtifactDescriptor, DependencyDescriptor, License, ModuleDescriptor, ExcludeRule } +import org.apache.ivy.plugins.resolver.{ ChainResolver, DependencyResolver, IBiblioResolver } class MakePom(val log: Logger) { @deprecated("Use `write(Ivy, ModuleDescriptor, ModuleInfo, Option[Iterable[Configuration]], Set[String], NodeSeq, XNode => XNode, MavenRepository => Boolean, Boolean, File)` instead", "0.11.2") diff --git a/ivy/src/main/scala/sbt/ProjectResolver.scala b/ivy/src/main/scala/sbt/ProjectResolver.scala index 93b9fcd8a..92fa48bfe 100644 --- a/ivy/src/main/scala/sbt/ProjectResolver.scala +++ b/ivy/src/main/scala/sbt/ProjectResolver.scala @@ -6,13 +6,13 @@ package sbt import java.io.File import java.util.Date - import org.apache.ivy.core.{cache,module, report, resolve,search} +import org.apache.ivy.core.{ cache, module, report, resolve, search } import cache.{ ArtifactOrigin, RepositoryCacheManager } import search.{ ModuleEntry, OrganisationEntry, RevisionEntry } import module.id.ModuleRevisionId import module.descriptor.{ Artifact => IArtifact, DefaultArtifact, DependencyDescriptor, ModuleDescriptor } - import org.apache.ivy.plugins.namespace.Namespace - import org.apache.ivy.plugins.resolver.{DependencyResolver,ResolverSettings} +import org.apache.ivy.plugins.namespace.Namespace +import org.apache.ivy.plugins.resolver.{ DependencyResolver, ResolverSettings } import report.{ ArtifactDownloadReport, DownloadReport, DownloadStatus, MetadataArtifactDownloadReport } import resolve.{ DownloadOptions, ResolveData, ResolvedModuleRevision } diff --git a/project/Sbt.scala b/project/Sbt.scala index 215ccffb0..925d3b5cc 100644 --- a/project/Sbt.scala +++ b/project/Sbt.scala @@ -39,23 +39,23 @@ object Sbt extends Build { }, // TODO - To some extent these should take args to figure out what to do. commands += Command.command("release-libs-211") { state => - def lameAgregateTask(task: String): String = - s"all control/$task collectoins/$task io/$task" + def lameAgregateTask(task: String): String = + s"all control/$task collectoins/$task io/$task" // TODO - Pull scala version from setting somewhere useful "++ 2.11.0" :: - /// First test - lameAgregateTask("test") :: - // Note: You need the sbt-pgp plugin installed to release. - lameAgregateTask("publishSigned") :: - // Now restore the defaults. - "reload" :: state + /// First test + lameAgregateTask("test") :: + // Note: You need the sbt-pgp plugin installed to release. + lameAgregateTask("publishSigned") :: + // Now restore the defaults. + "reload" :: state }, commands += Command.command("release-sbt") { state => // TODO - Any sort of validation - "publishSigned" :: - "publishLauncher" :: - "release-libs-211" :: - state + "publishSigned" :: + "publishLauncher" :: + "release-libs-211" :: + state } ) @@ -85,13 +85,13 @@ object Sbt extends Build { /* **** Utilities **** */ - lazy val controlSub = baseProject(utilPath / "control", "Control") settings (Util.crossBuild:_*) - lazy val collectionSub = testedBaseProject(utilPath / "collection", "Collections") settings (Util.keywordsSettings: _*) settings (Util.crossBuild:_*) + lazy val controlSub = baseProject(utilPath / "control", "Control") settings (Util.crossBuild: _*) + lazy val collectionSub = testedBaseProject(utilPath / "collection", "Collections") settings (Util.keywordsSettings: _*) settings (Util.crossBuild: _*) lazy val applyMacroSub = testedBaseProject(utilPath / "appmacro", "Apply Macro") dependsOn (collectionSub) settings (scalaCompiler) // The API for forking, combining, and doing I/O with system processes lazy val processSub = baseProject(utilPath / "process", "Process") dependsOn (ioSub % "test->test") settings (scalaXml) // Path, IO (formerly FileUtilities), NameFilter and other I/O utility classes - lazy val ioSub = testedBaseProject(utilPath / "io", "IO") dependsOn (controlSub) settings (ioSettings: _*) settings (Util.crossBuild:_*) + lazy val ioSub = testedBaseProject(utilPath / "io", "IO") dependsOn (controlSub) settings (ioSettings: _*) settings (Util.crossBuild: _*) // Utilities related to reflection, managing Scala versions, and custom class loaders lazy val classpathSub = testedBaseProject(utilPath / "classpath", "Classpath") dependsOn (launchInterfaceSub, interfaceSub, ioSub) settings (scalaCompiler) // Command line-related utilities. diff --git a/project/Util.scala b/project/Util.scala index 9a74867ea..fa2df13bf 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -29,11 +29,11 @@ object Util { nightly211 <<= scalaVersion(_.startsWith("2.11.")), includeTestDependencies <<= nightly211(x => !x) ) - def crossBuild: Seq[Setting[_]] = + def crossBuild: Seq[Setting[_]] = Seq( crossPaths := (scalaBinaryVersion.value match { case "2.11" => true - case _ => false + case _ => false }) ) def commonSettings(nameString: String) = Seq( @@ -174,7 +174,7 @@ object Common { def lib(m: ModuleID) = libraryDependencies += m lazy val jlineDep = "jline" % "jline" % "2.11" lazy val jline = lib(jlineDep) - lazy val ivy = lib("org.apache.ivy" % "ivy" % "2.3.0") + lazy val ivy = lib("org.apache.ivy" % "ivy" % "2.3.0") lazy val httpclient = lib("commons-httpclient" % "commons-httpclient" % "3.1") lazy val jsch = lib("com.jcraft" % "jsch" % "0.1.46" intransitive ()) lazy val sbinary = libraryDependencies += "org.scala-tools.sbinary" %% "sbinary" % "0.4.2" diff --git a/project/build.properties b/project/build.properties index 8ac605a3d..be6c454fb 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.2 +sbt.version=0.13.5 diff --git a/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala b/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala index 38feaca37..16f7bfc45 100644 --- a/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala +++ b/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala @@ -4,7 +4,7 @@ import java.io.{ StringWriter, PrintWriter, File } import java.net.InetAddress import scala.collection.mutable.ListBuffer import scala.util.DynamicVariable -import scala.xml.{Elem, Node=>XNode, XML} +import scala.xml.{ Elem, Node => XNode, XML } import testing.{ Event => TEvent, Status => TStatus, OptionalThrowable, TestSelector } /** @@ -23,7 +23,7 @@ class JUnitXmlTestsListener(val outputDir: String) extends TestsListener { { val iter = System.getProperties.entrySet.iterator - val props:ListBuffer[XNode] = new ListBuffer() + val props: ListBuffer[XNode] = new ListBuffer() while (iter.hasNext) { val next = iter.next props += From 87e9250cb23eb9798f51891c4959c8561265abc1 Mon Sep 17 00:00:00 2001 From: Dan Sanduleac Date: Mon, 19 May 2014 16:08:53 +0100 Subject: [PATCH 08/13] Revert "Load global plugins in their own class loader and replace the base loader with that. Fixes #272." This reverts commit 8cb7e230110e846b577539e61757e815f083294e. Conflicts: main/src/main/scala/sbt/Load.scala --- main/src/main/scala/sbt/Load.scala | 22 +++++-------------- .../sbt-test/project/global-plugin-src/test | 4 ---- .../project/global-plugin/changes/Build.scala | 21 ------------------ .../global-plugin/changes/global-plugins.sbt | 3 --- .../project/global-plugin/changes/plugins.sbt | 2 -- .../global/plugins/A.scala | 0 .../project/Build.scala | 0 sbt/src/sbt-test/project/global-plugin/test | 19 +++------------- 8 files changed, 8 insertions(+), 63 deletions(-) delete mode 100644 sbt/src/sbt-test/project/global-plugin-src/test delete mode 100644 sbt/src/sbt-test/project/global-plugin/changes/Build.scala delete mode 100644 sbt/src/sbt-test/project/global-plugin/changes/global-plugins.sbt delete mode 100644 sbt/src/sbt-test/project/global-plugin/changes/plugins.sbt rename sbt/src/sbt-test/project/{global-plugin-src => global-plugin}/global/plugins/A.scala (100%) rename sbt/src/sbt-test/project/{global-plugin-src => global-plugin}/project/Build.scala (100%) diff --git a/main/src/main/scala/sbt/Load.scala b/main/src/main/scala/sbt/Load.scala index 34d4bbcc3..a3dc684d0 100755 --- a/main/src/main/scala/sbt/Load.scala +++ b/main/src/main/scala/sbt/Load.scala @@ -73,25 +73,17 @@ object Load { } def buildGlobalSettings(base: File, files: Seq[File], config: sbt.LoadBuildConfiguration): ClassLoader => Seq[Setting[_]] = { - val eval = mkEval(data(config.classpath), base, defaultEvalOptions) + val eval = mkEval(data(config.globalPluginClasspath), base, defaultEvalOptions) val imports = BuildUtil.baseImports ++ BuildUtil.importAllRoot(config.globalPluginNames) loader => EvaluateConfigurations(eval, files, imports)(loader).settings } def loadGlobal(state: State, base: File, global: File, config: sbt.LoadBuildConfiguration): sbt.LoadBuildConfiguration = if (base != global && global.exists) { val gp = GlobalPlugin.load(global, state, config) - val pm = setGlobalPluginLoader(gp, config.pluginManagement) - val cp = (gp.data.fullClasspath ++ config.classpath).distinct - config.copy(globalPlugin = Some(gp), pluginManagement = pm, classpath = cp) + config.copy(globalPlugin = Some(gp)) } else config - private[this] def setGlobalPluginLoader(gp: GlobalPlugin, pm: PluginManagement): PluginManagement = - { - val newLoader = ClasspathUtilities.toLoader(data(gp.data.fullClasspath), pm.initialLoader) - pm.copy(initialLoader = newLoader) - } - def defaultDelegates: sbt.LoadedBuild => Scope => Seq[Scope] = (lb: sbt.LoadedBuild) => { val rootProject = getRootProject(lb.units) def resolveRef(project: Reference): ResolvedReference = Scope.resolveReference(lb.root, rootProject, project) @@ -688,7 +680,6 @@ object Load { DiscoveredProjects(root.headOption, nonRoot, rawFiles) } - @deprecated("No longer used.", "0.13.0") def globalPluginClasspath(globalPlugin: Option[GlobalPlugin]): Seq[Attributed[File]] = globalPlugin match { case Some(cp) => cp.data.fullClasspath @@ -733,7 +724,7 @@ object Load { !(dir * -GlobFilter(DefaultTargetName)).get.isEmpty } def noPlugins(dir: File, config: sbt.LoadBuildConfiguration): sbt.LoadedPlugins = - loadPluginDefinition(dir, config, PluginData(config.classpath, None, None)) + loadPluginDefinition(dir, config, PluginData(config.globalPluginClasspath, None, None)) def buildPlugins(dir: File, s: State, config: sbt.LoadBuildConfiguration): sbt.LoadedPlugins = loadPluginDefinition(dir, config, buildPluginDefinition(dir, s, config)) @@ -903,11 +894,8 @@ final case class LoadBuildConfiguration( globalPlugin: Option[GlobalPlugin], extraBuilds: Seq[URI], log: Logger) { - @deprecated("Use `classpath`.", "0.13.0") - lazy val globalPluginClasspath = classpath - @deprecated("Use `pluginManagement.initialLoader`.", "0.13.0") - lazy val globalPluginLoader = pluginManagement.initialLoader - lazy val globalPluginNames = if (classpath.isEmpty) Nil else Load.getPluginNames(classpath, pluginManagement.initialLoader) + lazy val (globalPluginClasspath, globalPluginLoader) = Load.pluginDefinitionLoader(this, Load.globalPluginClasspath(globalPlugin)) + lazy val globalPluginNames = if (globalPluginClasspath.isEmpty) Nil else Load.getPluginNames(globalPluginClasspath, globalPluginLoader) } final class IncompatiblePluginsException(msg: String, cause: Throwable) extends Exception(msg, cause) diff --git a/sbt/src/sbt-test/project/global-plugin-src/test b/sbt/src/sbt-test/project/global-plugin-src/test deleted file mode 100644 index a100beb21..000000000 --- a/sbt/src/sbt-test/project/global-plugin-src/test +++ /dev/null @@ -1,4 +0,0 @@ -# tests that a source file in $sbt.global.base/plugins/ is available to the build definition in project/ - -# dummy to ensure project gets loaded -> name diff --git a/sbt/src/sbt-test/project/global-plugin/changes/Build.scala b/sbt/src/sbt-test/project/global-plugin/changes/Build.scala deleted file mode 100644 index 64db72659..000000000 --- a/sbt/src/sbt-test/project/global-plugin/changes/Build.scala +++ /dev/null @@ -1,21 +0,0 @@ -import sbt._ -import sbt.Keys._ - -object MyBuild extends Build { - lazy val mySettings = Defaults.defaultSettings ++ Seq( - name := "my-test-proj", - organization := "com.example", - check <<= update map checkVersion, - version := "0.1.0-SNAPSHOT") - - lazy val proj = Project("my-test-proj", file("."), settings = mySettings) - - lazy val check = taskKey[Unit]("Verifies that the junit dependency has the older version (4.5)") - - def checkVersion(report: UpdateReport) { - for(mod <- report.allModules) { - if(mod.name == "junit") assert(mod.revision == "4.5", s"JUnit version (${mod.revision}) was not overridden") - } - } -} - diff --git a/sbt/src/sbt-test/project/global-plugin/changes/global-plugins.sbt b/sbt/src/sbt-test/project/global-plugin/changes/global-plugins.sbt deleted file mode 100644 index 9e2ae07df..000000000 --- a/sbt/src/sbt-test/project/global-plugin/changes/global-plugins.sbt +++ /dev/null @@ -1,3 +0,0 @@ -// use a small java library instead of a plugin to avoid incompatibilities when upgrading -// use an old version to check that it will override a newer version in a build definition -libraryDependencies += "junit" % "junit" % "4.5" diff --git a/sbt/src/sbt-test/project/global-plugin/changes/plugins.sbt b/sbt/src/sbt-test/project/global-plugin/changes/plugins.sbt deleted file mode 100644 index 0cfd68572..000000000 --- a/sbt/src/sbt-test/project/global-plugin/changes/plugins.sbt +++ /dev/null @@ -1,2 +0,0 @@ -// the version should be overridden by the global plugin -libraryDependencies += "junit" % "junit" % "4.8" diff --git a/sbt/src/sbt-test/project/global-plugin-src/global/plugins/A.scala b/sbt/src/sbt-test/project/global-plugin/global/plugins/A.scala similarity index 100% rename from sbt/src/sbt-test/project/global-plugin-src/global/plugins/A.scala rename to sbt/src/sbt-test/project/global-plugin/global/plugins/A.scala diff --git a/sbt/src/sbt-test/project/global-plugin-src/project/Build.scala b/sbt/src/sbt-test/project/global-plugin/project/Build.scala similarity index 100% rename from sbt/src/sbt-test/project/global-plugin-src/project/Build.scala rename to sbt/src/sbt-test/project/global-plugin/project/Build.scala diff --git a/sbt/src/sbt-test/project/global-plugin/test b/sbt/src/sbt-test/project/global-plugin/test index 0d7ace21b..a100beb21 100644 --- a/sbt/src/sbt-test/project/global-plugin/test +++ b/sbt/src/sbt-test/project/global-plugin/test @@ -1,17 +1,4 @@ -$ copy-file changes/Build.scala project/Build.scala -> reload +# tests that a source file in $sbt.global.base/plugins/ is available to the build definition in project/ -# ensure that a new global dependency gets picked up -$ copy-file changes/global-plugins.sbt global/plugins/plugins.sbt -> reload - -# check that the class can be loaded -> eval Class.forName("org.junit.Test") - -# check that it is on the classpath -> eval (x => ()) : (org.junit.Test => Unit) - -# ensure that the global plugin version overrides the local version -$ copy-file changes/plugins.sbt project/plugins.sbt -> reload -> check +# dummy to ensure project gets loaded +> name From d970ab3af37c167c3a744bf71860ae862ae8f1d0 Mon Sep 17 00:00:00 2001 From: Dan Sanduleac Date: Mon, 19 May 2014 18:29:23 +0100 Subject: [PATCH 09/13] Re-add scripted test --- .../project/global-plugin/changes/Build.scala | 21 +++++++++++++++++++ .../global-plugin/changes/global-plugins.sbt | 3 +++ .../project/global-plugin/changes/plugins.sbt | 2 ++ sbt/src/sbt-test/project/global-plugin/test | 20 +++++++++++++++--- 4 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 sbt/src/sbt-test/project/global-plugin/changes/Build.scala create mode 100644 sbt/src/sbt-test/project/global-plugin/changes/global-plugins.sbt create mode 100644 sbt/src/sbt-test/project/global-plugin/changes/plugins.sbt diff --git a/sbt/src/sbt-test/project/global-plugin/changes/Build.scala b/sbt/src/sbt-test/project/global-plugin/changes/Build.scala new file mode 100644 index 000000000..2e1d49e2f --- /dev/null +++ b/sbt/src/sbt-test/project/global-plugin/changes/Build.scala @@ -0,0 +1,21 @@ +import sbt._ +import sbt.Keys._ + +object MyBuild extends Build { + lazy val mySettings = Defaults.defaultSettings ++ Seq( + name := "my-test-proj", + organization := "com.example", + check <<= update map checkVersion, + version := "0.1.0-SNAPSHOT") + + lazy val proj = Project("my-test-proj", file("."), settings = mySettings) + + lazy val check = taskKey[Unit]("Verifies that the junit dependency has the newer version (4.8)") + + def checkVersion(report: UpdateReport) { + for(mod <- report.allModules) { + if(mod.name == "junit") assert(mod.revision == "4.8", s"JUnit version (${mod.revision}) does not have the correct version") + } + } +} + diff --git a/sbt/src/sbt-test/project/global-plugin/changes/global-plugins.sbt b/sbt/src/sbt-test/project/global-plugin/changes/global-plugins.sbt new file mode 100644 index 000000000..2214d0397 --- /dev/null +++ b/sbt/src/sbt-test/project/global-plugin/changes/global-plugins.sbt @@ -0,0 +1,3 @@ +// use a small java library instead of a plugin to avoid incompatibilities when upgrading +// This version should be overridden by the one in the project. +libraryDependencies += "junit" % "junit" % "4.5" diff --git a/sbt/src/sbt-test/project/global-plugin/changes/plugins.sbt b/sbt/src/sbt-test/project/global-plugin/changes/plugins.sbt new file mode 100644 index 000000000..8c116930a --- /dev/null +++ b/sbt/src/sbt-test/project/global-plugin/changes/plugins.sbt @@ -0,0 +1,2 @@ +// the version should override the one from the global plugin +libraryDependencies += "junit" % "junit" % "4.8" diff --git a/sbt/src/sbt-test/project/global-plugin/test b/sbt/src/sbt-test/project/global-plugin/test index a100beb21..f5ab8b106 100644 --- a/sbt/src/sbt-test/project/global-plugin/test +++ b/sbt/src/sbt-test/project/global-plugin/test @@ -1,4 +1,18 @@ -# tests that a source file in $sbt.global.base/plugins/ is available to the build definition in project/ +$ copy-file changes/Build.scala project/Build.scala +> reload -# dummy to ensure project gets loaded -> name +# ensure that a new global dependency gets picked up +$ copy-file changes/global-plugins.sbt global/plugins/plugins.sbt +> reload + +# check that the class can be loaded +> eval Class.forName("org.junit.Test") + +# check that it is on the classpath +> eval (x => ()) : (org.junit.Test => Unit) + +# ensure that the global plugin version is overridden by the local version +# (because it's older) +$ copy-file changes/plugins.sbt project/plugins.sbt +> reload +> check From b382cf464d91814740379bcf3e93e7e368738f73 Mon Sep 17 00:00:00 2001 From: Dan Sanduleac Date: Mon, 19 May 2014 18:31:43 +0100 Subject: [PATCH 10/13] build projects' transitiveUpdate to depend on globalPluginUpdate --- main/src/main/scala/sbt/Defaults.scala | 3 ++- main/src/main/scala/sbt/GlobalPlugin.scala | 17 ++++++++++++----- main/src/main/scala/sbt/Keys.scala | 1 + 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/main/src/main/scala/sbt/Defaults.scala b/main/src/main/scala/sbt/Defaults.scala index a6d696342..81db813de 100755 --- a/main/src/main/scala/sbt/Defaults.scala +++ b/main/src/main/scala/sbt/Defaults.scala @@ -301,7 +301,8 @@ object Defaults extends BuildCommon { import ScopeFilter.Make.{ inDependencies => inDeps, _ } val selectDeps = ScopeFilter(inDeps(ThisProject, includeRoot = false)) val allUpdates = update.?.all(selectDeps) - Def.task { allUpdates.value.flatten } + // If I am a "build" (a project inside project/) then I have a globalPluginUpdate. + Def.task { allUpdates.value.flatten ++ globalPluginUpdate.?.value } } def watchSetting: Initialize[Watched] = (pollInterval, thisProjectRef, watchingMessage, triggeredMessage) { (interval, base, msg, trigMsg) => diff --git a/main/src/main/scala/sbt/GlobalPlugin.scala b/main/src/main/scala/sbt/GlobalPlugin.scala index 8118c84e1..d1339c8f1 100644 --- a/main/src/main/scala/sbt/GlobalPlugin.scala +++ b/main/src/main/scala/sbt/GlobalPlugin.scala @@ -18,6 +18,7 @@ object GlobalPlugin { projectDescriptors ~= { _ ++ gp.descriptors }, projectDependencies ++= gp.projectID +: gp.dependencies, resolvers <<= resolvers { rs => (rs ++ gp.resolvers).distinct }, + globalPluginUpdate := gp.updateReport, // TODO: these shouldn't be required (but are): the project* settings above should take care of this injectInternalClasspath(Runtime, gp.internalClasspath), injectInternalClasspath(Compile, gp.internalClasspath) @@ -44,10 +45,16 @@ object GlobalPlugin { { import structure.{ data, root, rootProject } val p: Scope = Scope.GlobalScope in ProjectRef(root, rootProject(root)) - val taskInit = (projectID, projectDependencies, projectDescriptors, resolvers, fullClasspath in Runtime, internalDependencyClasspath in Runtime, exportedProducts in Runtime, ivyModule) map { - (pid, pdeps, pdescs, rs, cp, intcp, prods, mod) => - val depMap = pdescs + mod.dependencyMapping(state.log) - GlobalPluginData(pid, pdeps, depMap, rs, cp, (prods ++ intcp).distinct) + + val taskInit = Def.task { + val intcp = (internalDependencyClasspath in Runtime).value + val prods = (exportedProducts in Runtime).value + val depMap = projectDescriptors.value + ivyModule.value.dependencyMapping(state.log) + // If we reference it directly (if it's an executionRoot) then it forces an update, which is not what we want. + val updateReport = Def.taskDyn { Def.task { update.value } }.value + + GlobalPluginData(projectID.value, projectDependencies.value, depMap, resolvers.value, (fullClasspath in Runtime).value, + (prods ++ intcp).distinct, updateReport) } val resolvedTaskInit = taskInit mapReferenced Project.mapScope(Scope replaceThis p) val task = resolvedTaskInit evaluate data @@ -72,5 +79,5 @@ object GlobalPlugin { version := "0.0" )) } -final case class GlobalPluginData(projectID: ModuleID, dependencies: Seq[ModuleID], descriptors: Map[ModuleRevisionId, ModuleDescriptor], resolvers: Seq[Resolver], fullClasspath: Classpath, internalClasspath: Classpath) +final case class GlobalPluginData(projectID: ModuleID, dependencies: Seq[ModuleID], descriptors: Map[ModuleRevisionId, ModuleDescriptor], resolvers: Seq[Resolver], fullClasspath: Classpath, internalClasspath: Classpath, updateReport: UpdateReport) final case class GlobalPlugin(data: GlobalPluginData, structure: BuildStructure, inject: Seq[Setting[_]], base: File) diff --git a/main/src/main/scala/sbt/Keys.scala b/main/src/main/scala/sbt/Keys.scala index 1f46e57c7..8c4b3f3b2 100644 --- a/main/src/main/scala/sbt/Keys.scala +++ b/main/src/main/scala/sbt/Keys.scala @@ -345,6 +345,7 @@ object Keys { val stateStreams = AttributeKey[Streams]("streams-manager", "Streams manager, which provides streams for different contexts. Setting this on State will override the default Streams implementation.") val resolvedScoped = Def.resolvedScoped val pluginData = TaskKey[PluginData]("plugin-data", "Information from the plugin build needed in the main build definition.", DTask) + val globalPluginUpdate = TaskKey[UpdateReport]("global-plugin-update", "A hook to get the UpdateReport of the global plugin.", DTask) // wrapper to work around SI-2915 private[sbt] final class TaskProgress(val progress: ExecuteProgress[Task]) From c006692fc3065eabacea204bf107c593433fa97d Mon Sep 17 00:00:00 2001 From: Dan Sanduleac Date: Tue, 20 May 2014 17:11:21 +0100 Subject: [PATCH 11/13] Make GlobalPluginData preserve compatibility wrt .unapply --- main/src/main/scala/sbt/GlobalPlugin.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/src/main/scala/sbt/GlobalPlugin.scala b/main/src/main/scala/sbt/GlobalPlugin.scala index d1339c8f1..88b767b94 100644 --- a/main/src/main/scala/sbt/GlobalPlugin.scala +++ b/main/src/main/scala/sbt/GlobalPlugin.scala @@ -54,7 +54,7 @@ object GlobalPlugin { val updateReport = Def.taskDyn { Def.task { update.value } }.value GlobalPluginData(projectID.value, projectDependencies.value, depMap, resolvers.value, (fullClasspath in Runtime).value, - (prods ++ intcp).distinct, updateReport) + (prods ++ intcp).distinct)(updateReport) } val resolvedTaskInit = taskInit mapReferenced Project.mapScope(Scope replaceThis p) val task = resolvedTaskInit evaluate data @@ -79,5 +79,5 @@ object GlobalPlugin { version := "0.0" )) } -final case class GlobalPluginData(projectID: ModuleID, dependencies: Seq[ModuleID], descriptors: Map[ModuleRevisionId, ModuleDescriptor], resolvers: Seq[Resolver], fullClasspath: Classpath, internalClasspath: Classpath, updateReport: UpdateReport) +final case class GlobalPluginData(projectID: ModuleID, dependencies: Seq[ModuleID], descriptors: Map[ModuleRevisionId, ModuleDescriptor], resolvers: Seq[Resolver], fullClasspath: Classpath, internalClasspath: Classpath)(val updateReport: UpdateReport) final case class GlobalPlugin(data: GlobalPluginData, structure: BuildStructure, inject: Seq[Setting[_]], base: File) From 68a2f57da9c0a86e12ffa6a7557c5422331e8413 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Wed, 28 May 2014 12:55:05 -0400 Subject: [PATCH 12/13] Allow autogenerated projects to have overridden organization. * Change detection of "default project" to accurately see if someone has changed the organization. * Add a flag to notify downstream consumers that a project was autogenerated and not user specified. Fixes #1315 --- main/src/main/scala/sbt/Build.scala | 12 ++++++------ main/src/main/scala/sbt/Keys.scala | 1 + sbt/src/sbt-test/project/auto-plugins/build.sbt | 7 ++++++- .../sbt-test/project/auto-plugins/project/Q.scala | 12 ++++++++++-- sbt/src/sbt-test/project/auto-plugins/test | 1 + 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/main/src/main/scala/sbt/Build.scala b/main/src/main/scala/sbt/Build.scala index d36ccbb97..6fd43bda0 100644 --- a/main/src/main/scala/sbt/Build.scala +++ b/main/src/main/scala/sbt/Build.scala @@ -4,7 +4,7 @@ package sbt import java.io.File -import Keys.{ name, organization, thisProject } +import Keys.{ name, organization, thisProject, autoGeneratedProject } import Def.{ ScopedKey, Setting } // name is more like BuildDefinition, but that is too long @@ -49,13 +49,13 @@ object Build { // TODO - Can we move this somewhere else? ordering of settings is causing this to get borked. // if the user has overridden the name, use the normal organization that is derived from the name. organization := { - val overridden = thisProject.value.id == name.value + def isDefault(o: String) = thisProject.value.id == o organization.?.value match { - case Some(o) if !overridden => o - case _ => "default" + case Some(o) if !isDefault(o) => o + case _ => "default" } - //(thisProject, organization, name) { (p, o, n) => if(p.id == n) "default" else o } - } + }, + autoGeneratedProject := true ) def defaultAggregatedProject(id: String, base: File, agg: Seq[ProjectRef]): Project = defaultProject(id, base).aggregate(agg: _*) diff --git a/main/src/main/scala/sbt/Keys.scala b/main/src/main/scala/sbt/Keys.scala index 1f46e57c7..fd1f99f88 100644 --- a/main/src/main/scala/sbt/Keys.scala +++ b/main/src/main/scala/sbt/Keys.scala @@ -36,6 +36,7 @@ object Keys { val sLog = SettingKey[Logger]("setting-logger", "Logger usable by settings during project loading.", CSetting) // Project keys + val autoGeneratedProject = SettingKey[Boolean]("autogeneratedProject", "If it exists, represents that the project (and name) were automaticlaly craeted, rather than user specified.", DSetting) val projectCommand = AttributeKey[Boolean]("project-command", "Marks Commands that were registered for the current Project.", Invisible) val sessionSettings = AttributeKey[SessionSettings]("session-settings", "Tracks current build, project, and setting modifications.", DSetting) val stateBuildStructure = AttributeKey[BuildStructure]("build-structure", "Data structure containing all information about the build definition.", BSetting) diff --git a/sbt/src/sbt-test/project/auto-plugins/build.sbt b/sbt/src/sbt-test/project/auto-plugins/build.sbt index 8819060f1..27cdb97cd 100644 --- a/sbt/src/sbt-test/project/auto-plugins/build.sbt +++ b/sbt/src/sbt-test/project/auto-plugins/build.sbt @@ -18,7 +18,10 @@ lazy val projF = project disablePlugins(plugins.IvyPlugin) check := { - // TODO - this will pass when the raw disablePlugin works. + // Ensure organization on root is overridable. + val rorg = (organization).value // Should be None + same(rorg, "override", "organization") + // this will pass when the raw disablePlugin works. val dversion = (projectID in projD).?.value // Should be None same(dversion, None, "projectID in projD") val rversion = projectID.?.value // Should be None @@ -44,6 +47,8 @@ check := { same(qValue, Some(" Q R"), "del in projC in q") val optInValue = (del in projE in q).value same(optInValue, " Q S R", "del in projE in q") + val overrideOrgValue = (organization in projE).value + same(overrideOrgValue, "S", "organization in projE") } keyTest := "foo" diff --git a/sbt/src/sbt-test/project/auto-plugins/project/Q.scala b/sbt/src/sbt-test/project/auto-plugins/project/Q.scala index afdf64b78..b607b170b 100644 --- a/sbt/src/sbt-test/project/auto-plugins/project/Q.scala +++ b/sbt/src/sbt-test/project/auto-plugins/project/Q.scala @@ -1,7 +1,7 @@ package sbttest // you need package http://stackoverflow.com/questions/9822008/ import sbt._ - import sbt.Keys.{name, resolvedScoped} + import sbt.Keys.{name, resolvedScoped, organization } import java.util.concurrent.atomic.{AtomicInteger => AInt} object Imports @@ -19,6 +19,13 @@ object Imports lazy val check = taskKey[Unit]("Verifies settings are as they should be.") } +object OrgPlugin extends AutoPlugin { + override def trigger = allRequirements + override def projectSettings = Seq( + organization := "override" + ) +} + object X extends AutoPlugin { val autoImport = Imports } @@ -84,6 +91,7 @@ object S extends AutoPlugin override def trigger = noTrigger override def projectSettings = Seq( - del in q += " S" + del in q += " S", + organization := "S" ) } diff --git a/sbt/src/sbt-test/project/auto-plugins/test b/sbt/src/sbt-test/project/auto-plugins/test index b1ab83bf7..518ca1bec 100644 --- a/sbt/src/sbt-test/project/auto-plugins/test +++ b/sbt/src/sbt-test/project/auto-plugins/test @@ -1,2 +1,3 @@ > plugins +> inspect organization > check From e0a96e3d7fac5c3ccea627baa5adb0e2343f6cc7 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Mon, 19 May 2014 09:30:39 -0400 Subject: [PATCH 13/13] Fix bug in release script due to typo. * Fix collection typo * Create shared command to setup 2.11 builds * Alter snapshot detection to allow more flexible milestone versioning. * Remove cusotm isSnapshot key for new sbt 0.13.2 isSnapshot key. --- project/Docs.scala | 2 +- project/Release.scala | 2 +- project/Sbt.scala | 11 +++++++---- project/Status.scala | 5 +++-- project/Transform.scala | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/project/Docs.scala b/project/Docs.scala index f4a9c85cc..565ccf3b3 100644 --- a/project/Docs.scala +++ b/project/Docs.scala @@ -1,6 +1,6 @@ import sbt._ import Keys._ -import Status.{ isSnapshot, publishStatus } +import Status.{ publishStatus } import com.typesafe.sbt.{ SbtGhPages, SbtGit, SbtSite, site => sbtsite } import SbtSite.{ site, SiteKeys } import SbtGhPages.{ ghpages, GhPagesKeys => ghkeys } diff --git a/project/Release.scala b/project/Release.scala index b3e52a57f..6d80f5b50 100644 --- a/project/Release.scala +++ b/project/Release.scala @@ -1,6 +1,6 @@ import sbt._ import Keys._ -import Status.{ isSnapshot, publishStatus } +import Status.{ publishStatus } import org.apache.ivy.util.url.CredentialsStore object Release extends Build { diff --git a/project/Sbt.scala b/project/Sbt.scala index 925d3b5cc..1c7e1d628 100644 --- a/project/Sbt.scala +++ b/project/Sbt.scala @@ -24,9 +24,13 @@ object Sbt extends Build { testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"), javacOptions in compile ++= Seq("-target", "6", "-source", "6", "-Xlint", "-Xlint:-serial"), incOptions := incOptions.value.withNameHashing(true), - commands += Command.command("checkBuildScala211") { state => + commands += Command.command("setupBuildScala211") { state => """set scalaVersion in ThisBuild := "2.11.0" """ :: "set Util.includeTestDependencies in ThisBuild := true" :: + state + }, + commands += Command.command("checkBuildScala211") { state => + "setupBuildScala211" :: // First compile everything before attempting to test "all compile test:compile" :: // Now run known working tests. @@ -40,9 +44,8 @@ object Sbt extends Build { // TODO - To some extent these should take args to figure out what to do. commands += Command.command("release-libs-211") { state => def lameAgregateTask(task: String): String = - s"all control/$task collectoins/$task io/$task" - // TODO - Pull scala version from setting somewhere useful - "++ 2.11.0" :: + s"all control/$task collections/$task io/$task" + "setupBuildScala211" :: /// First test lameAgregateTask("test") :: // Note: You need the sbt-pgp plugin installed to release. diff --git a/project/Status.scala b/project/Status.scala index ee6aaec6b..73ef5ab66 100644 --- a/project/Status.scala +++ b/project/Status.scala @@ -3,7 +3,6 @@ import Keys._ import java.util.regex.Pattern object Status { - lazy val isSnapshot = SettingKey[Boolean]("is-snapshot") lazy val publishStatus = SettingKey[String]("publish-status") def settings: Seq[Setting[_]] = Seq( @@ -25,5 +24,7 @@ object Status { format.format(new java.util.Date(time)) } final val Snapshot = "-SNAPSHOT" - def snapshotQualifier(v: String) = !Pattern.matches(""".+-(M|Alpha|Beta|RC)\d*""", v) + // NOte: This moved into sbt itself... But we need to add semantic knowledge of how + // we stamp our nightlies. + def snapshotQualifier(v: String) = Pattern.matches(""".+-.*SNAPSHOT.*""", v) } \ No newline at end of file diff --git a/project/Transform.scala b/project/Transform.scala index b45d47dfe..ae1ad02fd 100644 --- a/project/Transform.scala +++ b/project/Transform.scala @@ -59,7 +59,7 @@ object Transform { (ss --- sdirs) x (rebase(sdirs, sm) | flat(sm)) toSeq } def configSettings = transResourceSettings ++ seq( - resourceProperties <<= (organization, version, scalaVersion, Status.isSnapshot) map { (org, v, sv, isSnapshot) => + resourceProperties <<= (organization, version, scalaVersion, isSnapshot) map { (org, v, sv, isSnapshot) => Map("org" -> org, "sbt.version" -> v, "scala.version" -> sv, "repositories" -> repositories(isSnapshot).mkString(IO.Newline)) } )