rename atrium-scala to atrium-scala2 and change package structure

Don't prefix packages with scala but move it after ch.tutteli.atrium.
IMO it is not an extension like kotlin_1_3 and therefore should
not be at the end. Use scala2 as we are likely going to use atrium-scala
for scala 3 once it is out.
This commit is contained in:
Robert Stoll
2020-07-30 22:14:48 +02:00
parent 044edeaddd
commit 43cacaee88
23 changed files with 25 additions and 19 deletions

View File

@@ -0,0 +1,2 @@
version = "2.4.2"
maxColumn = 120

View File

@@ -0,0 +1,7 @@
description = 'A fluent assertion function API in en_GB with a focus on code completion for Scala.'
dependencies {
api atriumKotlinDep('logic')
testImplementation atriumKotlinDep('specs')
}

View File

@@ -0,0 +1,53 @@
package ch.tutteli.atrium.scala2.api.fluent.en_GB
import ch.tutteli.atrium.assertions.Assertion
import ch.tutteli.atrium.creating.Expect
import ch.tutteli.atrium.domain.builders.creating.AnyAssertionsBuilder
import ch.tutteli.atrium.logic.impl.DefaultAnyAssertions
import ch.tutteli.atrium.creating.AssertionContainer
class AnyAssertions[T](expect: Expect[T]) {
@inline private def anyAssertions: AnyAssertionsBuilder = ExpectImpl.getAny
def toBe(expected: T): Expect[T] = addAssertion(_.toBe(expect, expected))
def notToBe(expected: T): Expect[T] =
addAssertion(_.notToBe(expect, expected))
def isSameAs(expected: T): Expect[T] =
addAssertion(_.isSame(expect, expected))
def isNotSameAs(expected: T): Expect[T] =
addAssertion(_.isNotSame(expect, expected))
def toBeNullIfNullGivenElse(assertionCreatorOrNull: Expect[T] => Unit)(implicit kClass: KClassTag[T]): Expect[T] =
addAssertion(_.toBeNullIfNullGivenElse[T](expect, kClass.kClass, assertionCreatorOrNull))
def notToBeNull()(implicit kClass: KClassTag[T]): Expect[T] = isA[T]()
def notToBeNull(assertionCreator: Expect[T] => Unit)(implicit kClass: KClassTag[T]): Expect[T] =
isA[T](assertionCreator)
def isA[TSub]()(implicit kClass: KClassTag[TSub]): Expect[TSub] =
anyAssertions.isA(expect, kClass.kClass).getExpectOfFeature
def isA[TSub](assertionCreator: Expect[TSub] => Unit)(implicit kClass: KClassTag[TSub]): Expect[TSub] =
anyAssertions.isA(expect, kClass.kClass).addToFeature(assertionCreator)
val and: Expect[T] = expect
def and(assertionCreator: Expect[T] => Unit): Expect[T] = expect.addAssertionsCreatedBy(assertionCreator)
def isNoneOf(expected: T, otherValues: T*): Expect[T] = {
isNotIn(expected +: otherValues)
}
def isNotIn(iterable: Iterable[T]): Expect[T] = {
import scala.jdk.CollectionConverters._
expect.addAssertion(new DefaultAnyAssertions().isNotIn(expect.asInstanceOf[AssertionContainer[T]], iterable.asJava))
}
@inline private def addAssertion(f: AnyAssertionsBuilder => Assertion): Expect[T] =
expect.addAssertion(f(anyAssertions))
}

View File

@@ -0,0 +1,9 @@
package ch.tutteli.atrium.scala2.api.fluent.en_GB
import ch.tutteli.atrium.creating.Expect
import ch.tutteli.atrium.domain.creating.changers.PostFinalStep
trait BaseAssertions {
implicit class RxPostFinalStep[T, R, E <: Expect[R]](postStep: PostFinalStep[T, R, E]) {
@inline def expectOfFeature: E = postStep.getExpectOfFeature
}
}

View File

@@ -0,0 +1,33 @@
package ch.tutteli.atrium.scala2.api.fluent.en_GB
import scala.collection.generic.IsIterable
import ch.tutteli.atrium.creating.Expect
import java.lang.{Iterable => JIterable}
import scala.jdk.CollectionConverters._
object IsIterableHelpers {
type IsIterableFixA[Repr, A0] = IsIterable[Repr] { type A = A0 }
implicit class RxExpectIsIterable[Repr](expect: Expect[Repr]) {
def asExpectJIterable[E](implicit isIterable: IsIterableFixA[Repr, E]): Expect[JIterable[E]] =
ExpectImpl.changeSubject(expect).unreported { iterableLikeSubject =>
val subject = isIterable.apply(iterableLikeSubject)
subject match {
case l: List[E] => l.asJava
case l: Iterable[E] => l.asJava
case subject => subject.toList.asJava
}
}
}
implicit class RxExpectJ[E](expectJ: Expect[JIterable[E]]) {
def backToScalaRepr[Repr](originalExpect: Expect[Repr]): Expect[Repr] =
originalExpect.getMaybeSubject.fold(
() => expectJ.asInstanceOf[Expect[Repr]],
subject => ExpectImpl.changeSubject(expectJ).unreported(_ => subject)
)
}
}

View File

@@ -0,0 +1,24 @@
package ch.tutteli.atrium.scala2.api.fluent.en_GB
import java.lang.{Iterable => JIterable}
import IsIterableHelpers._
import ch.tutteli.atrium.creating.Expect
import ch.tutteli.atrium.domain.builders.creating.IterableAssertionsBuilder
class IterableLikeElementComparableAssertions[Repr, E <: Comparable[E]](expect: Expect[Repr])(
implicit isIterable: IsIterableFixA[Repr, E]
) extends BaseAssertions {
private val expectJ: Expect[JIterable[E]] = expect.asExpectJIterable
@inline private def iterableAssertions: IterableAssertionsBuilder = ExpectImpl.getIterable
def min(): Expect[E] = iterableAssertions.min[E, JIterable[E]](expectJ).expectOfFeature
def max(): Expect[E] = iterableAssertions.max[E, JIterable[E]](expectJ).expectOfFeature
def min(assertionCreator: Expect[E] => Unit): Expect[Repr] =
iterableAssertions.min[E, JIterable[E]](expectJ).addToInitial(assertionCreator).backToScalaRepr(expect)
def max(assertionCreator: Expect[E] => Unit): Expect[Repr] =
iterableAssertions.max[E, JIterable[E]](expectJ).addToInitial(assertionCreator).backToScalaRepr(expect)
}

View File

@@ -0,0 +1,109 @@
package ch.tutteli.atrium.scala2.api.fluent
import ch.tutteli.atrium.creating.Expect
import ch.tutteli.atrium.domain.builders.ExpectImpl
import _root_.scala.annotation.unchecked.uncheckedVariance
import kotlin.reflect.KClass
package object en_GB extends ScalaKotlinConversions {
import IsIterableHelpers._
@inline val ExpectImpl: ExpectImpl =
ch.tutteli.atrium.domain.builders.ExpectImpl.INSTANCE
implicit def expectToAnyAssertions[T](expect: Expect[T]): AnyAssertions[T] =
new AnyAssertions(expect)
implicit def expectToIterableLikeElementComparableAssertions[Repr, E <: Comparable[E]](expect: Expect[Repr])(
implicit it: IsIterableFixA[Repr, E]
): IterableLikeElementComparableAssertions[Repr, E] = new IterableLikeElementComparableAssertions(expect)
}
package en_GB {
import kotlin.jvm.internal.Reflection
import _root_.scala.reflect.ClassTag
trait ScalaKotlinConversions {
type KUnit = kotlin.Unit
type KFun0[+R] =
kotlin.jvm.functions.Function0[
R @uncheckedVariance
]
type KFun1[-T, +R] =
kotlin.jvm.functions.Function1[
T @uncheckedVariance,
R @uncheckedVariance
]
type KFun2[-T, -A1, +R] =
kotlin.jvm.functions.Function2[
T @uncheckedVariance,
A1 @uncheckedVariance,
R @uncheckedVariance
]
type KFun3[-T, -A1, -A2, +R] =
kotlin.jvm.functions.Function3[
T @uncheckedVariance,
A1 @uncheckedVariance,
A2 @uncheckedVariance,
R @uncheckedVariance
]
type KFun4[-T, -A1, -A2, -A3, +R] =
kotlin.jvm.functions.Function4[
T @uncheckedVariance,
A1 @uncheckedVariance,
A2 @uncheckedVariance,
A3 @uncheckedVariance,
R @uncheckedVariance
]
type KFun5[-T, -A1, -A2, -A3, -A4, +R] =
kotlin.jvm.functions.Function5[
T @uncheckedVariance,
A1 @uncheckedVariance,
A2 @uncheckedVariance,
A3 @uncheckedVariance,
A4 @uncheckedVariance,
R @uncheckedVariance
]
type KAssertionCreator[T] = KFun1[Expect[T], KUnit]
implicit def scalaAssertionCreatorToKotlin[T](
f: Expect[T] => Unit
): KAssertionCreator[T] =
if (f == null) null else e => { f(e); kotlin.Unit.INSTANCE }
implicit def scalaFun0ToKotlin[R](f: () => R): KFun0[R] =
if (f == null) null else f.apply _
implicit def scalaFun1ToKotlin[T, R](f: T => R): KFun1[T, R] =
if (f == null) null else f.apply _
implicit def scalaFun2ToKotlin[T, A1, R](f: (T, A1) => R): KFun2[T, A1, R] =
if (f == null) null else f.apply _
implicit def scalaFun3ToKotlin[T, A1, A2, R](
f: (T, A1, A2) => R
): KFun3[T, A1, A2, R] =
if (f == null) null else f.apply _
implicit def scalaFun4ToKotlin[T, A1, A2, A3, R](
f: (T, A1, A2, A3) => R
): KFun4[T, A1, A2, A3, R] =
if (f == null) null else f.apply _
implicit def scalaFun5ToKotlin[T, A1, A2, A3, A4, R](
f: (T, A1, A2, A3, A4) => R
): KFun5[T, A1, A2, A3, A4, R] =
if (f == null) null else f.apply _
implicit def kClass[T](implicit classTag: ClassTag[T]): KClassTag[T] =
new KClassTag(Reflection.createKotlinClass(classTag.runtimeClass).asInstanceOf[KClass[T]])
}
class KClassTag[T](val kClass: KClass[T]) extends AnyVal
}

View File

@@ -0,0 +1,64 @@
package ch.tutteli.atrium.scala2.api.fluent.en_GB
import TestUtils._
import AnyAssertionsSpec._
import ch.tutteli.atrium.creating.Expect
class AnyAssertionsSpec
extends ch.tutteli.atrium.specs.integration.AnyAssertionsSpec(
toBe,
toBe,
toBe.withNullableSuffix(),
toBe.withNullableSuffix(),
notToBe,
notToBe,
notToBe.withNullableSuffix(),
notToBe.withNullableSuffix(),
isSameAs,
isSameAs,
isSameAs.withNullableSuffix(),
isSameAs.withNullableSuffix(),
isNotSameAs,
isNotSameAs,
isNotSameAs.withNullableSuffix(),
isNotSameAs.withNullableSuffix(),
isNoneOf,
isNoneOf,
isNoneOf.withNullableSuffix(),
isNoneOf.withNullableSuffix(),
isNotIn,
isNotIn,
isNotIn.withNullableSuffix(),
isNotIn.withNullableSuffix(),
fun0("toBe", _.toBe(null)),
fun1("toBeNullIfNullGivenElse", _.toBeNullIfNullGivenElse(_)),
new kotlin.Pair("isA (feature)", _.isA()),
new kotlin.Pair("isA", _.isA(_)),
new kotlin.Pair("isA (feature)", _.isA()),
new kotlin.Pair("isA", _.isA(_)),
new kotlin.Pair("isA (feature)", _.isA()),
new kotlin.Pair("isA", _.isA(_)),
new kotlin.Pair("notToBeNull (feature)", _.notToBeNull()),
fun1("notToBeNull", _.notToBeNull(_)),
fun0("and (feature)", _.and),
fun1("and", _.and(_)),
"⚬ ",
"[Atrium] "
)
//noinspection TypeAnnotation
object AnyAssertionsSpec {
import scala.jdk.CollectionConverters._
def toBe[T]: Fun1[T, T] = fun1("toBe", _.toBe(_))
def notToBe[T]: Fun1[T, T] = fun1("notToBe", _.notToBe(_))
def isSameAs[T]: Fun1[T, T] = fun1("isSameAs", _.isSameAs(_))
def isNotSameAs[T]: Fun1[T, T] = fun1("isNotSameAs", _.isNotSameAs(_))
def isNoneOf[T]: Fun2[T, T, Array[T]] = fun2("isNoneOf", (e: Expect[T], t: T, arr: Array[T]) => e.isNoneOf(t, arr.toIndexedSeq: _*))
def isNotIn[T]: Fun1[T, java.lang.Iterable[T]] = fun1("isNotIn", (e: Expect[T], i: java.lang.Iterable[T]) => e.isNotIn(i.asScala))
implicit class RxKotlinPair[T](pair: kotlin.Pair[String, T]) {
def withNullableSuffix() = new kotlin.Pair(pair.getFirst+" (nullable)", pair.getSecond)
}
}

View File

@@ -0,0 +1,42 @@
package ch.tutteli.atrium.scala2.api.fluent.en_GB
import TestUtils._
import ch.tutteli.atrium.creating.Expect
import java.lang.{Iterable => JIterable}
import scala.reflect.ClassTag
import IterableFeatureAssertionsSpec._
import IsIterableHelpers._
// FIXME rewrite after fusing IterableFutureAssertionsSpec with IterableAssertionsSpecr
//class IterableFeatureAssertionsSpec
// extends ch.tutteli.atrium.specs.integration.IterableFeatureAssertionsSpec(
// feature0("min", changeToScalaIterable(_).min()),
// fun1("min", changeToScalaIterable(_).min(_).asExpectJIterable),
// feature0("max", changeToScalaIterable(_).max()),
// fun1("max", changeToScalaIterable(_).max(_).asExpectJIterable),
// "[Atrium] "
// )
//
//class ArrayFeatureAssertionsSpec
// extends ch.tutteli.atrium.specs.integration.IterableFeatureAssertionsSpec(
// feature0("min", changeToScalaArray(_).min()),
// fun1("min", changeToScalaArray(_).min(_).asExpectJIterable),
// feature0("max", changeToScalaArray(_).max()),
// fun1("max", changeToScalaArray(_).max(_).asExpectJIterable),
// "[Atrium] "
// )
//noinspection TypeAnnotation
object IterableFeatureAssertionsSpec {
def changeToScalaIterable[E](expect: Expect[JIterable[E]]) = {
import scala.jdk.CollectionConverters._
ExpectImpl.changeSubject(expect).unreported(s => s.asScala)
}
def changeToScalaArray[E: ClassTag](expect: Expect[JIterable[E]]) = {
import scala.jdk.CollectionConverters._
ExpectImpl.changeSubject(expect).unreported(s => s.asScala.toArray)
}
}

View File

@@ -0,0 +1,77 @@
package ch.tutteli.atrium.scala2.api.fluent.en_GB
import ch.tutteli.atrium.creating.Expect
object TestUtils {
implicit def kotlinAssertionCreatorToScala[T](f: KFun1[_ >: Expect[T], KUnit]): Expect[T] => Unit = {
val scalaF = kFun1ToScala(f)
if (scalaF == null) null else scalaF(_)
}
implicit def kFun0ToScala[R](f: KFun0[R]): () => R =
if (f == null) null else () => f.invoke()
implicit def kFun1ToScala[T, R](f: KFun1[T, R]): T => R =
if (f == null) null else f.invoke
implicit def kFun2ToScala[T, A1, R](f: KFun2[T, A1, R]): (T, A1) => R =
if (f == null) null else f.invoke
implicit def kFun3ToScala[T, A1, A2, R](f: KFun3[T, A1, A2, R]): (T, A1, A2) => R =
if (f == null) null else f.invoke
implicit def kFun4ToScala[T, A1, A2, A3, R](f: KFun4[T, A1, A2, A3, R]): (T, A1, A2, A3) => R =
if (f == null) null else f.invoke
implicit def kFun5ToScala[T, A1, A2, A3, A4, R](f: KFun5[T, A1, A2, A3, A4, R]): (T, A1, A2, A3, A4) => R =
if (f == null) null else f.invoke
type SpecPair[T] = kotlin.Pair[String, T]
type Feature0[T, R] = SpecPair[KFun1[Expect[T], Expect[R]]]
type Feature1[T, A1, R] = SpecPair[KFun2[Expect[T], A1, Expect[R]]]
type Feature2[T, A1, A2, R] = SpecPair[KFun3[Expect[T], A1, A2, Expect[R]]]
type Feature3[T, A1, A2, A3, R] = SpecPair[KFun4[Expect[T], A1, A2, A3, Expect[R]]]
type Feature4[T, A1, A2, A3, A4, R] = SpecPair[KFun5[Expect[T], A1, A2, A3, A4, Expect[R]]]
type Fun0[T] = Feature0[T, T]
type Fun1[T, A1] = Feature1[T, A1, T]
type Fun2[T, A1, A2] = Feature2[T, A1, A2, T]
type Fun3[T, A1, A2, A3] = Feature3[T, A1, A2, A3, T]
type Fun4[T, A1, A2, A3, A4] = Feature4[T, A1, A2, A3, A4, T]
def feature0[T, R](name: String, f: Expect[T] => Expect[R]): Feature0[T, R] =
new kotlin.Pair(name + " (feature)", f)
def feature1[T, A1, R](name: String, f: (Expect[T], A1) => Expect[R]): Feature1[T, A1, R] =
new kotlin.Pair(name + " (feature)", f)
def feature2[T, A1, A2, R](name: String, f: (Expect[T], A1, A2) => Expect[R]): Feature2[T, A1, A2, R] =
new kotlin.Pair(name + " (feature)", f)
def feature3[T, A1, A2, A3, R](name: String, f: (Expect[T], A1, A2, A3) => Expect[R]): Feature3[T, A1, A2, A3, R] =
new kotlin.Pair(name + " (feature)", f)
def feature4[T, A1, A2, A3, A4, R](
name: String,
f: (Expect[T], A1, A2, A3, A4) => Expect[R]
): Feature4[T, A1, A2, A3, A4, R] =
new kotlin.Pair(name + " (feature)", f)
def fun0[T](name: String, f: Expect[T] => Expect[T]): Fun0[T] =
new kotlin.Pair(name, f)
def fun1[T, A1](name: String, f: (Expect[T], A1) => Expect[T]): Fun1[T, A1] =
new kotlin.Pair(name, f)
def fun2[T, A1, A2](name: String, f: (Expect[T], A1, A2) => Expect[T]): Fun2[T, A1, A2] =
new kotlin.Pair(name, f)
def fun3[T, A1, A2, A3](name: String, f: (Expect[T], A1, A2, A3) => Expect[T]): Fun3[T, A1, A2, A3] =
new kotlin.Pair(name, f)
def fun4[T, A1, A2, A3, A4](name: String, f: (Expect[T], A1, A2, A3, A4) => Expect[T]): Fun4[T, A1, A2, A3, A4] =
new kotlin.Pair(name, f)
}

View File

@@ -0,0 +1,37 @@
buildscript {
rootProject.version = '0.13.0-SNAPSHOT'
rootProject.group = 'ch.tutteli.atrium'
ext {
atriumKotlinDep = { name -> "ch.tutteli.atrium:atrium-$name:$rootProject.version" }
// project setup
tutteli_plugins_version = '0.33.1'
kotlin_version = '1.3.72'
}
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "ch.tutteli:tutteli-gradle-spek:$tutteli_plugins_version"
}
}
subprojects {
repositories {
if (!System.getenv('CI')) {
mavenLocal()
}
mavenCentral()
jcenter()
}
apply plugin: 'scala'
apply plugin: 'java-library'
apply plugin: 'kotlin'
apply plugin: 'ch.tutteli.spek'
dependencies {
implementation 'org.scala-lang:scala-library:2.13.2'
}
}

Binary file not shown.

View File

@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

183
atrium-scala2/gradlew vendored Executable file
View File

@@ -0,0 +1,183 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

View File

@@ -0,0 +1,21 @@
rootProject.name = 'atrium-scala2'
buildscript {
gradle.ext.tutteli_plugins_version = '0.32.2'
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "ch.tutteli:tutteli-gradle-settings:$gradle.ext.tutteli_plugins_version"
}
}
apply plugin: 'ch.tutteli.settings'
//noinspection GroovyAssignabilityCheck
include {
apis("api-") {
_ 'fluent-en_GB'
}
}