From 3be890fed51a53987de417b52c7b92275e802173 Mon Sep 17 00:00:00 2001 From: Hadi Hariri Date: Wed, 20 Aug 2014 20:31:03 +0200 Subject: [PATCH 1/2] Upgrade to latest Kotlin --- .idea/gradle.xml | 1 - ...ins_kotlin_kotlin_runtime_0_1_SNAPSHOT.xml | 2 ++ ...ains_kotlin_kotlin_stdlib_0_1_SNAPSHOT.xml | 2 ++ ...__org_mongodb_mongo_java_driver_2_12_2.xml | 3 +++ .../Gradle__org_spek_spek_0_1_SNAPSHOT.xml | 2 ++ build.gradle | 24 +++++++++++++++++++ .../kotlinx/nosql/mongodb/MongoDBSession.kt | 2 +- 7 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 486cf2f3..51eac9a1 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -14,7 +14,6 @@ - diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_1_SNAPSHOT.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_1_SNAPSHOT.xml index 7ac09b47..97af6ee0 100644 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_1_SNAPSHOT.xml +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_1_SNAPSHOT.xml @@ -2,10 +2,12 @@ + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_1_SNAPSHOT.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_1_SNAPSHOT.xml index 65084240..fe23f108 100644 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_1_SNAPSHOT.xml +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_1_SNAPSHOT.xml @@ -2,10 +2,12 @@ + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_mongodb_mongo_java_driver_2_12_2.xml b/.idea/libraries/Gradle__org_mongodb_mongo_java_driver_2_12_2.xml index 9bd351f5..29ddab63 100644 --- a/.idea/libraries/Gradle__org_mongodb_mongo_java_driver_2_12_2.xml +++ b/.idea/libraries/Gradle__org_mongodb_mongo_java_driver_2_12_2.xml @@ -1,5 +1,8 @@ + + + diff --git a/.idea/libraries/Gradle__org_spek_spek_0_1_SNAPSHOT.xml b/.idea/libraries/Gradle__org_spek_spek_0_1_SNAPSHOT.xml index 9be2e697..dd82c951 100644 --- a/.idea/libraries/Gradle__org_spek_spek_0_1_SNAPSHOT.xml +++ b/.idea/libraries/Gradle__org_spek_spek_0_1_SNAPSHOT.xml @@ -2,10 +2,12 @@ + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 88199804..b21b8810 100644 --- a/build.gradle +++ b/build.gradle @@ -1,23 +1,35 @@ configurations.all { // check for updates every build resolutionStrategy.cacheChangingModulesFor 0, 'seconds' + + } buildscript { + ext.kotlin_version = '0.1-SNAPSHOT' repositories { mavenCentral() maven { url "http://oss.sonatype.org/content/repositories/snapshots" } + maven { + url 'http://oss.sonatype.org/content/repositories/snapshots' + } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:0.1-SNAPSHOT" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } +apply plugin: 'kotlin' allprojects { apply plugin: "kotlin" + compileKotlin { + kotlinOptions.annotations = file('annotations/Gradle_ org.mongodb_mongo-java-driver_2.12.2') + } + group = "org.jetbrains.kotlin" version = "0.1-SNAPSHOT" @@ -64,6 +76,7 @@ allprojects { */ } + project(':kotlin-nosql-mongodb') { dependencies { compile project(':') @@ -76,4 +89,15 @@ project(':kotlin-nosql-redis') { compile project(':') compile('redis.clients:jedis:2.5.1') } +} +repositories { + maven { + url 'http://oss.sonatype.org/content/repositories/snapshots' + } +} +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" +} +sourceSets { + main.java.srcDirs += 'src/main/kotlin' } \ No newline at end of file diff --git a/kotlin-nosql-mongodb/src/main/kotlin/kotlinx/nosql/mongodb/MongoDBSession.kt b/kotlin-nosql-mongodb/src/main/kotlin/kotlinx/nosql/mongodb/MongoDBSession.kt index dc1ab5ce..c41d9af5 100644 --- a/kotlin-nosql-mongodb/src/main/kotlin/kotlinx/nosql/mongodb/MongoDBSession.kt +++ b/kotlin-nosql-mongodb/src/main/kotlin/kotlinx/nosql/mongodb/MongoDBSession.kt @@ -433,7 +433,7 @@ class MongoDBSession(val db: DB) : Session, DocumentSchemaOperations, TableSchem s = schema newInstance(schema.valueClass) } - val schemaClass = s.javaClass + val schemaClass = s?.javaClass val schemaFields = getAllFields(schemaClass as Class) val valueFields = getAllFieldsMap(valueInstance.javaClass as Class) for (schemaField in schemaFields) { From 08d0f8ae58c8a7bf1104956f617d7ddb2f74fd2e Mon Sep 17 00:00:00 2001 From: Hadi Hariri Date: Wed, 20 Aug 2014 21:59:50 +0200 Subject: [PATCH 2/2] Upgrade to latest Kotlin and 2.12.3 of MongoDb --- .idea/.name | 2 +- .idea/gradle.xml | 3 +- .../Gradle__joda_time_joda_time_2_3.xml | 4 +- .idea/libraries/Gradle__junit_junit_4_11.xml | 4 +- ...__org_apache_commons_commons_pool2_2_0.xml | 4 +- ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 4 +- ...ins_kotlin_kotlin_runtime_0_1_SNAPSHOT.xml | 4 +- ...ains_kotlin_kotlin_stdlib_0_1_SNAPSHOT.xml | 4 +- ...__org_mongodb_mongo_java_driver_2_12_2.xml | 14 -- .../Gradle__org_spek_spek_0_1_SNAPSHOT.xml | 4 +- .../Gradle__redis_clients_jedis_2_5_1.xml | 4 +- .idea/misc.xml | 130 +++++++++++++++++- .idea/vcs.xml | 1 + build.gradle | 6 +- kotlin-nosql-mongodb/kotlin-nosql-mongodb.iml | 14 +- kotlin-nosql-redis/kotlin-nosql-redis.iml | 12 +- kotlin-nosql.iml | 12 +- 17 files changed, 161 insertions(+), 65 deletions(-) delete mode 100644 .idea/libraries/Gradle__org_mongodb_mongo_java_driver_2_12_2.xml diff --git a/.idea/.name b/.idea/.name index 70faccd0..2cec005b 100644 --- a/.idea/.name +++ b/.idea/.name @@ -1 +1 @@ -Kotlin NoSQL \ No newline at end of file +kotlin-nosql \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 51eac9a1..ffb067a0 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -3,10 +3,9 @@ \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_1_SNAPSHOT.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_1_SNAPSHOT.xml index fe23f108..9afa572a 100644 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_1_SNAPSHOT.xml +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_1_SNAPSHOT.xml @@ -2,12 +2,12 @@ - + - + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_mongodb_mongo_java_driver_2_12_2.xml b/.idea/libraries/Gradle__org_mongodb_mongo_java_driver_2_12_2.xml deleted file mode 100644 index 29ddab63..00000000 --- a/.idea/libraries/Gradle__org_mongodb_mongo_java_driver_2_12_2.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_spek_spek_0_1_SNAPSHOT.xml b/.idea/libraries/Gradle__org_spek_spek_0_1_SNAPSHOT.xml index dd82c951..66d926f0 100644 --- a/.idea/libraries/Gradle__org_spek_spek_0_1_SNAPSHOT.xml +++ b/.idea/libraries/Gradle__org_spek_spek_0_1_SNAPSHOT.xml @@ -2,12 +2,12 @@ - + - + \ No newline at end of file diff --git a/.idea/libraries/Gradle__redis_clients_jedis_2_5_1.xml b/.idea/libraries/Gradle__redis_clients_jedis_2_5_1.xml index 0095a3f7..53a736bc 100644 --- a/.idea/libraries/Gradle__redis_clients_jedis_2_5_1.xml +++ b/.idea/libraries/Gradle__redis_clients_jedis_2_5_1.xml @@ -1,11 +1,11 @@ - + - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 4ae29228..dfd75a9a 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,14 +1,134 @@ - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.6 + + + + + + diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 275077f8..276779e8 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,6 +2,7 @@ + diff --git a/build.gradle b/build.gradle index b21b8810..3e606342 100644 --- a/build.gradle +++ b/build.gradle @@ -26,10 +26,6 @@ apply plugin: 'kotlin' allprojects { apply plugin: "kotlin" - compileKotlin { - kotlinOptions.annotations = file('annotations/Gradle_ org.mongodb_mongo-java-driver_2.12.2') - } - group = "org.jetbrains.kotlin" version = "0.1-SNAPSHOT" @@ -80,7 +76,7 @@ allprojects { project(':kotlin-nosql-mongodb') { dependencies { compile project(':') - compile 'org.mongodb:mongo-java-driver:2.12.2' + compile 'org.mongodb:mongo-java-driver:2.12.3' } } diff --git a/kotlin-nosql-mongodb/kotlin-nosql-mongodb.iml b/kotlin-nosql-mongodb/kotlin-nosql-mongodb.iml index abe07ea9..96047e01 100644 --- a/kotlin-nosql-mongodb/kotlin-nosql-mongodb.iml +++ b/kotlin-nosql-mongodb/kotlin-nosql-mongodb.iml @@ -1,16 +1,14 @@ - - - - + + + - - + @@ -19,11 +17,11 @@ + - - + diff --git a/kotlin-nosql-redis/kotlin-nosql-redis.iml b/kotlin-nosql-redis/kotlin-nosql-redis.iml index b5700f81..752cf8df 100644 --- a/kotlin-nosql-redis/kotlin-nosql-redis.iml +++ b/kotlin-nosql-redis/kotlin-nosql-redis.iml @@ -1,16 +1,14 @@ - - - - + + + - - + @@ -23,8 +21,8 @@ - + diff --git a/kotlin-nosql.iml b/kotlin-nosql.iml index 4492adb4..a1c2cc04 100644 --- a/kotlin-nosql.iml +++ b/kotlin-nosql.iml @@ -1,16 +1,14 @@ - - - - + + + - - + @@ -20,8 +18,8 @@ - +