Commit Graph

7202 Commits

Author SHA1 Message Date
eugene yokota 88b2e84559 Merge pull request #3211 from scalacenter/move-sbt-util-second-attempt
Move `util-appmacro` to sbt as `core-macros`
2017-05-23 22:05:23 -04:00
jvican 10c737ae20
Move to `core-macros` and depend on it 2017-05-24 00:16:26 +02:00
jvican d2f019a47a
Reformat all util-appmacro 2017-05-24 00:16:23 +02:00
jvican ed38fcd695
Move `util-appmacro` to sbt as `core-macros`
This commit moves everything behind the old util-appmacro over to
sbt/sbt.

appmacro has been renamed as core-macros. It is indeed the project
that defines the main logic to manipulate macros, and defines interfaces
that are then implemented by main-settings. Because of this strong
relationship between these two modules, I find that they have to stay
together and be able to be modified in one commit. I've realised this
while hacking on the macro changes for the usability of sbt.

The reason for this change is because the logic of this module is really
tight to the implementation of sbt and, I would even say, essentially
define the sbt DSL.
2017-05-24 00:16:21 +02:00
jvican db88e89c42
Merge HEAD, branch 'move-util-2' of ../sbt-util into move-sbt-util-second-attempt 2017-05-24 00:13:52 +02:00
jvican 551c5d9aa4 Add headers to files missing it 2017-05-22 17:02:32 +02:00
jvican 66c34d180e Move `ClasspathOptionsUtil` to the Java public API
Move the previous Scala implementation to Java as static methods.
2017-05-22 17:00:29 +02:00
jvican 19ddb6f2a2 Move ZincBridgeProvider to `xsbti.compile`
Before, we were using `sbt.inc`. As we have settled to define all the
interfaces in the `xsbti.compile` namespaces, it's not worth it to force
users remember other locations for the interfaces forwarding the default
implementations in Scala.
2017-05-22 16:07:53 +02:00
jvican e071577d6a Hide Zinc Compilation implementation
Before, we had made this public in `sbt.inc`, but this is not necessary
anymore.
2017-05-22 15:54:20 +02:00
jvican c8560c6b4e Add `ZincCompilerUtil` to get the Scalac compiler
* Move `IncrementalCompilerUtil` to `ZincCompilerUtil`.
* Change `IncrementalCompilerUtil` to an interface with static methods.
* Remove bug in which ScalaInstance implementation was leaking to the
  public API.
2017-05-22 15:49:26 +02:00
jvican 96f7e08864 Remove the use of `BaseIvySpecification`
This is the proof that we're now testing the Zinc public API because
we're resolving with the ivy options and resolution specified in the
default compiler bridge provider.
2017-05-21 20:21:58 +02:00
jvican 4d0f06a2ee Add public method to get default component provider
Expose default component provider through a static method in
`ZincCompilerBridge`. This method is necessary to invoke the bridge.

Removes the previous global lock and component provider implementations
in `BridgeProviderSpecification`.
2017-05-21 20:21:58 +02:00
jvican 6d012abaf9 Remove verbose Java global lock implementation 2017-05-21 20:21:58 +02:00
jvican aa3527996f Add public method to get no-op global lock 2017-05-21 20:21:58 +02:00
jvican 025c4cef9a Add public method to get a local ivy resolver 2017-05-21 20:21:58 +02:00
jvican c228ce8817 Add Java API for Zinc Ivy integration
* Adds a method to fetch the default implementation of the compiler
  provider.
* Adds a method to get a default `IvyConfiguration` from a small number
  of parameters.

The public API is implemented in Java to ensure binary compatibility no
matter what happens to the internal Scala implementations. It also makes
it easier for Java users to use the API and avoid importing MODULE$'s
and Scala generated class files.'
2017-05-21 20:21:57 +02:00
jvican d794ead617 Fix error when showing unresolved warning lines 2017-05-21 20:21:57 +02:00
jvican 47415e7def Compile bridge for 2.12.x and other Scala versions
This commit makes sure that we always check that we compile against the
latest two versions in Scala 2.10, Scala 2.11 and Scala 2.12.

This commit also removes the null loggers and uses normal loggers to
check what the output of the bridge provider is. This output is
important and the rationale to do this is that it should be visible for
us in order to detect cases where there's a regression or the output is
modified in some way. Output is short anyway.
2017-05-21 20:21:57 +02:00
jvican f4c38c8355 Test `getScalaInstance` & `getCompiledBridge`
* Remove unused code in `BridgeProviderSpecification` and test the real
  code in the default provider.
* Don't use temporary directory to download the Scala jars, retrive them
  in a directory specified by the user.
* Use `java.net.ClassLoader` instead of `ScalaClassLoader`.
* Use the `ScalaInstance` interface, not the implementation. Remove any
  reference to the implementation.
2017-05-21 20:21:57 +02:00
jvican ae40c096e3 Remove custom `getScalaInstance` and use default 2017-05-21 20:21:57 +02:00
jvican 62a5037d23 Add `getScalaInstance` to `CompilerBridgeProvider` 2017-05-21 20:21:57 +02:00
jvican d48f65a8a7 Fix oversight in InvalidComponent message 2017-05-21 20:21:57 +02:00
jvican 8d9d007d3c Rename `getCompilerSources` to `getCompiledBridge`
Previous name was incorrect, we actually return the compiled bridge.
2017-05-21 20:21:57 +02:00
jvican e756f07aed Add headers to files that don't have them 2017-05-21 20:21:56 +02:00
jvican 3f1cce379f Add `CompilerBridgeProvider` interface and misc.
* Add interface for the provider.
* Rename `IvyComponentCompiler` to `ZincComponentCompiler`.
* Split `ZincComponentCompiler` and `ZincComponentManager`.
* Define `IfMissing` and `InvalidComponent` into independent files.
* Rename variables and internal API to be clearer.
2017-05-21 20:21:56 +02:00
Dale Wijnand 5e585e50da Merge pull request #3200 from eed3si9n/wip/testlog2
Fixes content log not showing up on test task
2017-05-19 07:55:24 +01:00
Eugene Yokota 2b5637270a update TestFramework
- update reset.sh for debugging
- use Vector around TestFramework
- unbind existing appdenders from newLog
- register string codec for TestStringEvent
2017-05-19 00:16:19 -04:00
Eugene Yokota b013c30c30 Fix content log not showing up on `test`
Fixes #3198

Bump util to 1.0.0-M24. This fixes content log not showing up on `test`
2017-05-19 00:15:19 -04:00
eugene yokota b5cc77ef75 Merge pull request #3193 from dwijnand/better-toError-migration-notes
Better toError migration notes [ci skip]
2017-05-16 16:42:54 -04:00
Dale Wijnand 859b334a51
Better toError migration notes [ci skip] 2017-05-16 10:21:14 +01:00
eugene yokota d3ff3fb63a migrate PluginTrigger and ProjectOrigin to Contraband (#3191)
and move TestFramework to a non case class.
2017-05-13 13:01:51 +01:00
Dale Wijnand 50cc045a70 Merge pull request #3189 from eed3si9n/wip/more-case-class
[sbt 1.0] migrate ForkOptions to Contraband
2017-05-12 11:12:48 +01:00
Eugene Yokota 3724277704 migrate ForkOptions to Contraband 2017-05-12 05:22:08 -04:00
Dale Wijnand 0b2081bc3c Merge pull request #3184 from dwijnand/sbt-1-on-1
Upgrade the build to use sbt 1.0.0-M5
2017-05-11 10:31:21 +01:00
Dale Wijnand 0b33c195ef
Upgrade the build to sbt 1.0.0-M5
Some plugins remain commented out, for now.

sbt-doge is no longer needed because a variant of it has been folded
into sbt 1.

For some reason scripted requires src/doc jars of sbt, so switch back to
using `publishAll` rather than `publishLocalBinAll`. :(

Also, the sys.prop change in scripted is to force log4j2 to not use a
thread context classloader, and avoid the following:

    ERROR StatusLogger Unable to create custom ContextSelector. Falling back to default.
     java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.async.AsyncLoggerContextSelector to org.apache.logging.log4j.core.selector.ContextSelector
    	at java.lang.Class.cast(Class.java:3369)
    	at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
    	at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
    	at org.apache.logging.log4j.core.impl.Log4jContextFactory.createContextSelector(Log4jContextFactory.java:97)
    	at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    	at java.lang.Class.newInstance(Class.java:442)
    	at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:94)
    	at org.apache.logging.log4j.spi.ThreadContextMapFactory.createThreadContextMap(ThreadContextMapFactory.java:73)
    	at org.apache.logging.log4j.ThreadContext.init(ThreadContext.java:223)
    	at org.apache.logging.log4j.ThreadContext.<clinit>(ThreadContext.java:202)
    	at org.apache.logging.log4j.core.impl.ContextDataInjectorFactory.createDefaultInjector(ContextDataInjectorFactory.java:83)
    	at org.apache.logging.log4j.core.impl.ContextDataInjectorFactory.createInjector(ContextDataInjectorFactory.java:67)
    	at org.apache.logging.log4j.core.lookup.ContextMapLookup.<init>(ContextMapLookup.java:34)
    	at org.apache.logging.log4j.core.lookup.Interpolator.<init>(Interpolator.java:117)
    	at org.apache.logging.log4j.core.config.AbstractConfiguration.<init>(AbstractConfiguration.java:125)
    	at org.apache.logging.log4j.core.config.DefaultConfiguration.<init>(DefaultConfiguration.java:46)
    	at org.apache.logging.log4j.core.layout.PatternLayout$Builder.build(PatternLayout.java:650)
    	at org.apache.logging.log4j.core.layout.PatternLayout.createDefaultLayout(PatternLayout.java:487)
    	at sbt.internal.util.ConsoleAppender.<init>(ConsoleAppender.scala:245)
    	at sbt.internal.util.ConsoleAppender$.apply(ConsoleAppender.scala:196)
    	at sbt.internal.util.ConsoleLogger.<init>(ConsoleAppender.scala:42)
    	at sbt.internal.util.ConsoleLogger$.apply(ConsoleAppender.scala:34)
    	at sbt.test.ScriptedRunner.run(ScriptedTests.scala:221)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at Scripted$.doScripted(Scripted.scala:125)
    	at $0483e89d182e9d240274$.$anonfun$scriptedTask$5(build.sbt:301)
2017-05-11 09:44:42 +01:00
eugene yokota b1a1d03009 Merge pull request #3180 from eed3si9n/wip/zero2
[sbt 1.0] Rename scope component Global to Zero (`in Global` stays the same)
2017-05-10 16:48:40 -04:00
eugene yokota a265600154 Merge pull request #3151 from scalacenter/parallel-scripted-tests
Add parallel batch mode to scripted tests
2017-05-10 16:46:01 -04:00
jvican f967f6c1d7
Split project and aggregate project-load 2017-05-10 21:40:23 +02:00
jvican 272afa9d73
Try another travis structure + build tweaks
I've tried to put together some scripted tests to remove the overhead of
compiling the whole sbt, which is around 3 minutes every time.

This new structure *should* make the scripted tests run faster.

Aside from this, we do some more tweaks:

* Increase memory.
* Fork processes to compile and run (to see if it makes a difference).
* Pass in the server flag to sbt.
2017-05-10 21:40:23 +02:00
jvican 6813eb47af
Up memory for every scripted instance 2017-05-10 21:40:23 +02:00
jvican 3d6e0f9327
Handle empty case in `labelsAndDirs` 2017-05-10 21:40:22 +02:00
jvican 5e44ec7c53
Fix string-to-command to ignore existing commands
The scripted batch executor injects a command and the operation
performed in this test checks all the commands, assuming only `noop` is
declared.
2017-05-10 21:40:22 +02:00
jvican e01f5f5ef1
Fix auto-plugins temporarily until #3163 is fixed
Unfortunately, I think this uncovers a bug in duplicated computation of
settings in the `ThisBuild` and `Global` axis.
2017-05-10 21:40:22 +02:00
jvican 388ed641fb
Create a compiler plugin for scripted
The compiler plugin is more appropriate than running a series of
commands because of the effects of `set`.
2017-05-10 21:40:22 +02:00
jvican 80c8883219
Reboot to ditch state produced by scripted reload 2017-05-10 21:40:22 +02:00
jvican 628517e60c
Try travis with 3 cores and 725M per instance 2017-05-10 21:40:21 +02:00
jvican 7519e63f50
Set name of root project if no name is known
This commit makes sure that between every run in batch mode the local
root project name is updated if no name is set.

This fixes project/generated-root-no-project that was assuming that the
root directory name was `generated-root-no-project`. This invariant does
not hold anymore with the batch-mode. Now one sbt dir is shared for lots
of scripted tests.
2017-05-10 21:40:21 +02:00
jvican 9b3a2e6f0f
Fix project/binary-plugin: Reload was implied
The first `>` that appears kickstarts the execution of sbt, so it
implies a reload. This is no longer true for the batch test execution.
2017-05-10 21:40:21 +02:00
jvican 8aee628297
Fix #3610: project/old-ops
`compile` does nothing in this test, what we need to do is `reload`.
2017-05-10 21:40:21 +02:00
jvican 0ebf2d14a3
Fix more tests using compiler iterations 2017-05-10 21:40:21 +02:00