[samples] Move arithmetic parser common code into a separate project
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.2.21'
|
||||
ext.kotlin_version = '1.2.31'
|
||||
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -4,6 +4,10 @@ konan.targets = ['iphone', 'iphone_sim']
|
||||
|
||||
konanArtifacts {
|
||||
framework('KotlinArithmeticParser') {
|
||||
srcDir 'parser/src/main/kotlin'
|
||||
enableMultiplatform true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
expectedBy project(':calculator:parser')
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.2.21'
|
||||
ext.kotlin_version = '1.2.31'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -10,7 +10,7 @@ buildscript {
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
apply plugin: 'kotlin-platform-jvm'
|
||||
apply plugin: 'application'
|
||||
|
||||
repositories {
|
||||
@@ -18,8 +18,8 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib"
|
||||
compile "org.jetbrains.kotlin.konan.samples:arithmetic-parser"
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
expectedBy project(":calculator:parser")
|
||||
}
|
||||
|
||||
applicationName = "KotlinCalculator"
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
includeBuild '../parser'
|
||||
@@ -1,5 +1,5 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.2.21'
|
||||
ext.kotlin_version = '1.2.31'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -10,7 +10,7 @@ buildscript {
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
apply plugin: 'kotlin-platform-common'
|
||||
|
||||
group = 'org.jetbrains.kotlin.konan.samples'
|
||||
|
||||
@@ -19,5 +19,5 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib"
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
rootProject.name = 'arithmetic-parser'
|
||||
@@ -272,7 +272,7 @@ internal class Tokenizer(private val expression: String) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun Char.isNumberChar(): Boolean = this.isDigit() || this == '.'
|
||||
private fun Char.isNumberChar(): Boolean = this in '0'..'9' || this == '.'
|
||||
|
||||
fun tryReadBinaryOperator(): BinaryOperator? = BinaryOperator.values().firstOrNull { tryRead(it.sign) }
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// NOTE: If a new sample uses only platform libs,
|
||||
// please add it into the 'buildSamplesWithPlatfromLibs' task in build.gradle.
|
||||
include ':calculator'
|
||||
include ':calculator:jvmCliApp'
|
||||
include ':calculator:parser'
|
||||
include ':csvparser'
|
||||
include ':gitchurn'
|
||||
include ':globalState'
|
||||
|
||||
Reference in New Issue
Block a user