Commit Graph

869 Commits

Author SHA1 Message Date
Mark Harrah f388b07632 fix inputTask construction method and put sbt package object in proper directory 2012-12-09 20:40:41 -05:00
Mark Harrah e3745540c9 More cleanup of Scala version handling, including managedScalaInstance to control automatic 'scala-tool' configuration and dependencies. 2012-12-09 20:40:41 -05:00
Mark Harrah 912948f5c8 update 'apply' help string to include -cp option 2012-12-09 20:40:41 -05:00
Mark Harrah d4fd136192 support defining Projects in .sbt files
vals of type Project are added to the Build
2012-12-09 20:40:41 -05:00
Grzegorz Kossakowski ef39aeb9c1 Follow source layout convention supported by Eclipse.
Moved source files so directory structure follow package
structure. That makes it possible to use Scala Eclipse plugin
with sbt's source code.
2012-12-07 10:27:08 -08:00
Mark Harrah f55c8ca15e Tab completion of right side of setting in 'set' command no longer necessary with the new task syntax. 2012-12-06 19:11:07 -05:00
Mark Harrah 769ecbace5 add scala-tool configuration and dependencies when configuring via pom.xml/ivy.xml 2012-12-06 07:25:41 -05:00
Mark Harrah 8f25b07d71 -cp/-classpath option to 'apply' command 2012-12-04 21:08:39 -05:00
Mark Harrah 005b2b356f fix IO tests, which needed scala-compiler.jar on the classpath 2012-12-04 13:20:03 -05:00
Josh Suereth f338018bd1 Modified SBT defualts to pull in app repositories.
* If SBT launcher supports app repositories these are added by default.
* IF SBT launcher does not support app repositories, previous defaults are used.
2012-12-04 13:10:10 -05:00
Josh Suereth 0c08c1169e Bumped the Scalatest/Specs versions for 2.10.0-RC3
* Modified tests to use mutable Specs API
* Fixed a few minor specs issues.
2012-12-04 13:10:09 -05:00
Mark Harrah cdd2e72cdf move top-level settingKey,taskKey,inputKey objects to Def and package object
avoids class file name collision on case insensitive filesystem
2012-12-04 13:08:52 -05:00
Mark Harrah 495e7c6f62 Disable aggregation for `run-main` by default 2012-12-03 08:56:22 -05:00
Mark Harrah 2598a8f1a9 extend source positions to all setting creation methods 2012-12-02 03:17:20 -05:00
Mark Harrah f73e77de16 convert () to {} to workaround macro bug
(bug is fixed in 2.10.x branch)
2012-12-02 03:17:20 -05:00
Mark Harrah 2f2596c133 record source name or full path for settings/tasks depending on whether the enclosing package is the empty package 2012-12-02 03:17:20 -05:00
Mark Harrah a8d0af9464 split out KeyMacro.enclosingTrees 2012-12-02 03:17:20 -05:00
Mark Harrah 8400b992af source positions for settings/tasks in .scala files 2012-12-02 03:17:20 -05:00
Mark Harrah 3bff14d77a taskKey,settingKey,inputKey macros to get name from the defining val 2012-12-02 03:17:20 -05:00
Mark Harrah 538f687208 Use and methods instead of mapR,mapFailure,flatFailure,flatMapR 2012-12-02 03:17:19 -05:00
Mark Harrah c23226d4ae comment EvaluateTask.apply methods 2012-12-02 03:17:19 -05:00
Mark Harrah bb1725f580 Allow root project to be explicitly specified in Build.rootProject 2012-11-18 10:55:26 -05:00
Mark Harrah a9289ad0ce Explicitly specify type parameters in calls to KCons in KList builder.
scalac couldn't infer the type constructor otherwise.
2012-11-18 09:20:26 -05:00
Mark Harrah a38bce8d41 Transition to all camelCase key labels.
1. Hyphenated labels are still accepted when parsing scoped keys (so 'sbt test-only' still works)
   There is currently no timeline for removing this support for hyphenated keys.
2. Only camelCase is shown for tab completion.
3. AttributeKey.rawLabel provides the unnormalized label.
   This should only be used to implement support for accepting hyphenated keys as input for compatibility.
4. AttributeKey.normLabel provides the normalized label (hyphenated converted to camelCase)
2012-11-17 20:23:07 -05:00
Mark Harrah 49e7214fe3 InputTask macro
Similar to task macros, the parsed value is accessed by calling `parsed`
on a Parser[T], Initialize[Parser[T]], or Initialize[State => Parser[T]].
Values of tasks and settings may be accessed as usual via `value`.
2012-11-17 20:23:07 -05:00
Mark Harrah 79aeb7b00e fix testListeners definition, which mixed old and new styles of definitions, resulting in runtime error
This is an example of the need for an annotation to indicate a method shouldn't survive type checking.
2012-11-17 20:23:07 -05:00
Mark Harrah 522414cd99 AbsTypeTag -> WeakTypeTag and converted more settings 2012-11-17 20:23:06 -05:00
Mark Harrah e47a357ab7 Resolve Scala version for projects in the normal `update` task.
1. Scala jars won't be copied to the boot directory, except for those needed to run sbt.
2. Scala SNAPSHOTs behave like normal SNAPSHOTs.  In particular, running `update` will properly re-resolve the dynamic revision.
3. Scala jars are resolved using the same repositories and configuration as other dependencies.
4. Classloaders (currently, Scala classloaders) are cached by the timestamps of entries instead of Scala class loaders being cached by version.

TODO: Support external dependency configuration
2012-11-17 20:23:06 -05:00
Mark Harrah 4cc5bece70 address a valid unchecked warning
In order to correctly pattern match Tree subclasses in reflection/macros,
scalac needs the corresponding implicit for *Tag available because the types
are only abstract types.
2012-11-17 20:23:06 -05:00
Mark Harrah 2c7e9cd893 Scala 2.10.0-M7 2012-11-17 20:23:06 -05:00
Mark Harrah b453af7c45 Properly apply transformations to dynamic tasks.
That is, implement Initialize[Task[T]].flatten correctly.
This requires preserving the transformations applied in a scope so that
they can be applied to an Initialize value after static settings have been
evaluated.
2012-11-17 20:23:06 -05:00
Mark Harrah 0a642f2283 move explicit task/setting macros to Def, move to AbsTypeTag 2012-11-17 20:23:06 -05:00
Mark Harrah 3790d6656a failing use case 2012-11-17 20:23:06 -05:00
Mark Harrah 90faeff546 Task macro cleanup
* use normal TypeTree constructor
* remove unnecessary 'with Singleton' in macro utility
* integrate changes suggested by @xeno-by
* add refVar back and call asTypeConstructor instead of asType to refer to a type variable
2012-11-17 20:22:39 -05:00
Mark Harrah 1c22478edc task setting macros for :=, +=, ++=
also, bump to 2.10.0-M6
2012-11-17 20:19:24 -05:00
Mark Harrah 2e120ed86f split out InputTask 2012-11-17 20:19:24 -05:00
Mark Harrah 8d6dd10798 2.10.0-M5, different arity generalization
1. KList[M[_]] now instead of KList[HL <: HList, M[_]]
  a. head, tail work properly in this variant
  b. disadvantage is that full type not easily transformed to new type constructor
2. AList abstracts on K[L[x]], a higher order type constructor.
 A. Instances written for:
  a. KList
  b. Seq[M[T]] for a fixed T
  c. TupleN
  d. single values
  e. operate on one type constructor when nested
 B. Main disadvantage is type inference.  It just doesn't happen for K[L[x]].
    This is mitigated by AList being used internally and rarely needing to construct a K.
2012-11-17 20:19:24 -05:00
Mark Harrah eecaeafbdf reorganization of main/
* split several source files
* move base settings sources (Scope, Structure, ...) into main/settings/
* breaks cycles.  In particular, setting system moved from Project to Def
2012-11-17 20:19:24 -05:00
Mark Harrah 87e406fcbd support vals/defs in build.sbt
* must start with val, lazy val, or def (no modifiers currently)
* visible only within the same .sbt file
* multiple definitions allowed without being separated by blank lines
* no blank lines allowed within a definition
2012-11-17 16:27:25 -05:00
Mark Harrah f99ba44703 Control over automatically added settings.
Project.autoSettings accepts a sequence of AddSettings, instances of which
are constructed from methods in AddSettings.  The configurable settings
are per-user settings (from ~/.sbt, for example), settings from .sbt files,
and plugin settings (project-level only).  The order in which these instances
are provided to autoSettings determines the order in which they are appended
to the settings explicitly provided in Project.settings.

For .sbt files, defaultSbtFiles adds the settings from all .sbt files in the
project's base directory as usual.  AddSettings.sbtFiles accepts a sequence
of Files that will be loaded according to the standard .sbt format.  Relative
Files are resolved against the project's base directory.

Plugin settings may be included on a per-Plugin basis by using the plugins
method and passing a Plugin => Boolean.  The settings controlled here are
only the automatic per-project settings.  Per-build and global settings will
always be included.
2012-11-16 09:56:49 -05:00
Eugene Vigdorchik 960d17c358 Use java.lang.Throwable.setStackTrace. Proper fix for #543. 2012-11-15 10:14:59 -05:00
Mark Harrah 1c1e5c4977 taking care of deprecations removed in Scala master 2012-11-14 11:48:06 -05:00
Mark Harrah 9bf5405621 Fixes #594. Global plugin products weren't being included on Compile classpath of build definition project. 2012-11-10 18:18:15 -05:00
Mark Harrah 313bb1f8f2 deprecate Project-level delegation 2012-10-29 12:34:47 -04:00
Mark Harrah e1c3240eae split ForkTests react() out to workaround SI-6526 2012-10-29 12:22:07 -04:00
Mark Harrah e532d20732 cleanup of #585: compatible with earlier launchers 2012-10-29 09:52:10 -04:00
Eric Bowman 835ee0d1b3 XSBT-5: maven-style ivy repo support in the launcher config
Change-Id: I22c1ff126961d61d92e2e45a5b7eff329d3def90
Reviewed-on: https://gerrit.gilt.com/10950
Reviewed-by: Eric Bowman <ebowman@gilt.com>
Tested-by: Eric Bowman <ebowman@gilt.com>
2012-10-29 09:04:42 -04:00
Mark Harrah 1612af8dbb Parser.failOnException method, don't let rhs of alias fail the parse. Fixes #572.
alias only parses the right hand side for tab completion help.
The assignment should happen whether or not the parse is successful because the
context may change by the time the alias is actually evaluated.
In particular, the 'set' command uses the loaded project for tab completion in 0.12.1.
When a .sbtrc file is processed, the project has not been loaded yet, so aliases
involving set fail.  Wrapping the rhs in failOnException addresses this.
2012-10-15 12:42:27 -04:00
Mark Harrah a2c2af8b08 add [every] to syntax summary of 'set' command 2012-09-22 16:45:24 -04:00
Kevin Scaldeferri 933d5fb0fe Include all JAR packaging types in the default classpathTypes. Fixes #550
These special types need to be recognized in both the POM parser and added to the classpath.
The previous code was not DRY, and eclipse-plugin was in one but not the other.  This ensures
new types can be added in the future without risking this type of oversight.
2012-09-21 16:56:56 -04:00