xerial/sbt-pack — pull request #2 by xuwei-k (2012-11-21 01:49:54+00:00)
Title: add scripted tests

example をscripted test標準のテスト用ディレクトリに移して簡単なテスト加えてみました。

http://eed3si9n.com/ja/testing-sbt-plugins

メモリの設定の理由についてはこちら
http://d.hatena.ne.jp/xuwei/20120511/1336695143

複数のversion (sbt0.11.2や0.11.3)に対応させようとすると、以下の様なことをするか
http://d.hatena.ne.jp/xuwei/20120517/1337227845

専用のsbt-plugin使わないといけなくて面倒なのですが
https://github.com/jrudolph/sbt-cross-building

もともと、sbt0.12.xしかpublishしてないようなので、scripted pluginの設定もsbt0.12前提で書いてます(0.11系では動かない)

あと、なぜか `command-launcher` のほうのexampleをテストしようとしたら、以下のようなエラーになったので、 `pack` だけして、そのあとの実行の部分はとりあえずコメントにしてあります。

```
---------------------------------------------------
constituent[0]: file:/private/var/folders/hw/vqly1hs14p77yl70qbqzsxk00000gq/T/sbt_cb91f8a2/command-launcher/target/pack/lib/command-launcher-0.1-SNAPSHOT.jar
constituent[1]: file:/private/var/folders/hw/vqly1hs14p77yl70qbqzsxk00000gq/T/sbt_cb91f8a2/command-launcher/target/pack/lib/javassist-3.15.0-GA.jar
constituent[2]: file:/private/var/folders/hw/vqly1hs14p77yl70qbqzsxk00000gq/T/sbt_cb91f8a2/command-launcher/target/pack/lib/plexus-classworlds-2.4.jar
constituent[3]: file:/private/var/folders/hw/vqly1hs14p77yl70qbqzsxk00000gq/T/sbt_cb91f8a2/command-launcher/target/pack/lib/scala-compiler.jar
constituent[4]: file:/private/var/folders/hw/vqly1hs14p77yl70qbqzsxk00000gq/T/sbt_cb91f8a2/command-launcher/target/pack/lib/scala-library.jar
constituent[5]: file:/private/var/folders/hw/vqly1hs14p77yl70qbqzsxk00000gq/T/sbt_cb91f8a2/command-launcher/target/pack/lib/scalap-2.9.2.jar
constituent[6]: file:/private/var/folders/hw/vqly1hs14p77yl70qbqzsxk00000gq/T/sbt_cb91f8a2/command-launcher/target/pack/lib/xerial-core-3.1-SNAPSHOT.jar
constituent[7]: file:/private/var/folders/hw/vqly1hs14p77yl70qbqzsxk00000gq/T/sbt_cb91f8a2/command-launcher/target/pack/lib/xerial-lens-3.1-SNAPSHOT.jar
---------------------------------------------------
Exception in thread "main" java.lang.UnsupportedClassVersionError: xerial/lens/cui/option : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:386)
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
at xerial.lens.cui.ClassOptionSchema$$anonfun$apply$2$$anonfun$apply$3.apply(OptionParser.scala:198)
at xerial.lens.cui.ClassOptionSchema$$anonfun$apply$2$$anonfun$apply$3.apply(OptionParser.scala:195)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34)
at scala.collection.mutable.ArrayOps.foreach(ArrayOps.scala:38)
at xerial.lens.cui.ClassOptionSchema$$anonfun$apply$2.apply(OptionParser.scala:195)
at xerial.lens.cui.ClassOptionSchema$$anonfun$apply$2.apply(OptionParser.scala:195)
at scala.Option.foreach(Option.scala:197)
at xerial.lens.cui.ClassOptionSchema$.apply(OptionParser.scala:195)
at xerial.lens.cui.Launcher.(Launcher.scala:131)
at xerial.lens.cui.Launcher$.of(Launcher.scala:36)
at xerial.lens.cui.Launcher$.execute(Launcher.scala:42)
at launcher.Main$.main(Launcher.scala:10)
at launcher.Main.main(Launcher.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
```

これは、環境の問題ですかね？(java7でないと動かない?)自分が試したJava環境は `1.6.0_37` です