Skip to content

Commit ffd886e

Browse files
committed
initial import
1 parent e97ee60 commit ffd886e

7 files changed

+490
-0
lines changed

.classpath

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
5+
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
6+
<classpathentry kind="con" path="org.jetbrains.kotlin.core.KOTLIN_CONTAINER"/>
7+
<classpathentry kind="output" path="bin"/>
8+
</classpath>

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/

.project

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>tensorics-kotlin</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.jetbrains.kotlin.ui.kotlinBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.jdt.core.javabuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
</buildSpec>
24+
<natures>
25+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
26+
<nature>org.eclipse.jdt.core.javanature</nature>
27+
<nature>org.jetbrains.kotlin.core.kotlinNature</nature>
28+
</natures>
29+
<linkedResources>
30+
<link>
31+
<name>kotlin_bin</name>
32+
<type>2</type>
33+
<locationURI>org.jetbrains.kotlin.core.filesystem:/tensorics-kotlin/kotlin_bin</locationURI>
34+
</link>
35+
</linkedResources>
36+
</projectDescription>
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
build.commands=org.eclipse.jdt.core.javabuilder
2+
connection.arguments=
3+
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
4+
connection.java.home=null
5+
connection.jvm.arguments=
6+
connection.project.dir=
7+
derived.resources=.gradle,build
8+
eclipse.preferences.version=1
9+
natures=org.eclipse.jdt.core.javanature
10+
project.path=\:

build.gradle

+141
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
buildscript {
2+
project.ext.CERN_VM = System.getProperty('CERN_TECHNET_VM') ?: System.getenv('CERN_TECHNET_VM') ?: false
3+
project.ext.TRAVIS_CI = System.getProperty('TRAVIS') ?: System.getenv('TRAVIS') ?: false
4+
project.ext.DEPLOYMENT = System.getProperty('deployment') ?: false
5+
project.ext.VCS_TAG = System.getProperty('TRAVIS_TAG') ?: System.getenv('TRAVIS_TAG')
6+
project.ext.POM = [
7+
groupId : 'org.tensorics',
8+
artifactId : 'tensorics-kotlin',
9+
description: 'Kotlin DSL for tensorics.',
10+
developers : [
11+
[
12+
id : 'kaifox',
13+
name : 'Kajetan Fuchsberger',
14+
15+
],
16+
[
17+
id : 'agorzawski',
18+
name : 'Arek Gorzawski',
19+
20+
],
21+
[
22+
id : 'michi42',
23+
name : 'Michi Hostettler',
24+
25+
],
26+
[
27+
id : 'andreacalia',
28+
name : 'Andrea Calia',
29+
30+
]
31+
]]
32+
project.ext.INFO = [
33+
repo : 'https://github.com/tensorics/tensorics-kotlin.git',
34+
url : 'http://tensorics.org/',
35+
github : 'https://github.com/tensorics/tensorics-kotlin',
36+
githubIssues: 'https://github.com/tensorics/tensorics-kotlin/issues'
37+
]
38+
project.ext.BINTRAY = [
39+
repo : 'tensorics-repo',
40+
name : 'org.tensorics:tensorics-core',
41+
organization: 'tensorics',
42+
userName : 'tensorics-dev',
43+
apiToken : System.getenv('BINTRAY_API_TOKEN')
44+
]
45+
46+
repositories {
47+
if (CERN_VM) {
48+
maven { url 'http://artifactory.cern.ch/gradle-plugins' }
49+
maven { url 'http://artifactory.cern.ch/ds-jcenter' }
50+
maven { url 'http://artifactory.cern.ch/development' }
51+
} else {
52+
mavenCentral()
53+
jcenter()
54+
}
55+
}
56+
dependencies {
57+
classpath 'com.netflix.nebula:nebula-publishing-plugin:5.1.0'
58+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
59+
}
60+
}
61+
62+
apply plugin: 'java'
63+
apply plugin: 'jacoco'
64+
apply plugin: 'maven'
65+
apply plugin: 'maven-publish'
66+
apply plugin: 'nebula.maven-publish'
67+
apply plugin: 'com.jfrog.bintray'
68+
69+
repositories {
70+
if (CERN_VM) {
71+
maven { url 'http://artifactory.cern.ch/ds-jcenter' }
72+
maven { url 'http://artifactory.cern.ch/development' }
73+
} else {
74+
mavenCentral()
75+
jcenter()
76+
}
77+
}
78+
79+
if (DEPLOYMENT) {
80+
println 'Applying deployment scripts'
81+
apply from: './scripts/bintray-deploy.gradle'
82+
}
83+
84+
group 'org.streamingpool'
85+
86+
sourceCompatibility = 1.8
87+
88+
dependencies {
89+
compile 'org.tensorics:tensorics-core:+'
90+
compile 'org.jscience:jscience:4.3.1'
91+
compile 'com.google.guava:guava:21.0'
92+
compile 'org.hamcrest:hamcrest-all:1.3'
93+
compile 'org.slf4j:slf4j-api:1.7.21'
94+
95+
testCompile 'junit:junit:4.12'
96+
testCompile 'org.slf4j:slf4j-log4j12:+'
97+
testCompile 'pl.pragmatists:JUnitParams:1.0.4'
98+
testCompile 'org.mockito:mockito-core:1.10.19'
99+
testCompile 'org.objenesis:objenesis:2.4'
100+
testCompile 'com.openpojo:openpojo:0.8.4'
101+
testCompile 'org.assertj:assertj-core:3.6.1'
102+
testCompile 'nl.jqno.equalsverifier:equalsverifier:2.3.1'
103+
}
104+
105+
sourceSets {
106+
main {
107+
java {
108+
srcDir 'src/java'
109+
}
110+
}
111+
test {
112+
java {
113+
srcDir 'src/test'
114+
}
115+
}
116+
}
117+
118+
javadoc { options.encoding = "UTF-8" }
119+
120+
task wrapper(type: Wrapper) { gradleVersion = '4.0' }
121+
122+
task javadocJar(type: Jar) {
123+
classifier = 'javadoc'
124+
from javadoc
125+
}
126+
127+
task sourcesJar(type: Jar) {
128+
classifier = 'sources'
129+
from sourceSets.main.allSource
130+
}
131+
132+
artifacts { archives javadocJar, sourcesJar }
133+
134+
jacocoTestReport {
135+
reports {
136+
xml.enabled true
137+
xml.destination new File("${buildDir}/reports/jacoco/report.xml")
138+
html.enabled true
139+
csv.enabled false
140+
}
141+
}

src/AMain.kt

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import org.tensorics.core.tree.domain.ResolvedExpression
2+
import org.tensorics.core.tree.domain.Expression
3+
import org.tensorics.core.resolve.engine.ResolvingEngine
4+
import org.tensorics.core.resolve.engine.ResolvingEngines
5+
6+
7+
fun main(args: Array<String>) {
8+
var engine = ResolvingEngines.defaultEngine();
9+
10+
11+
var aValue = 0.2;
12+
var anExp = ResolvedExpression.of(0.3);
13+
14+
var another = aValue + anExp;
15+
16+
System.out.println(engine.resolve(another));
17+
}

0 commit comments

Comments
 (0)