Skip to content

Commit ff6e047

Browse files
committed
Adds more examples
1 parent 8d18a5b commit ff6e047

File tree

7 files changed

+936
-96
lines changed

7 files changed

+936
-96
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# kotlin-coroutines
2-
Just a set of examples using Kotlin coroutines
2+
3+
Set of examples using Kotlin coroutines, mainly for education purposes.

build.gradle

+40-95
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,66 @@
1-
group 'org.pedrofelixsour.kotlin'
2-
version '1.0-SNAPSHOT'
3-
41
buildscript {
52
ext {
6-
kotlinVersion = '1.2.41'
7-
springBootVersion = '2.0.2.RELEASE'
3+
kotlin_version = '1.3.0'
4+
springBootVersion = '2.1.0.RELEASE'
85
}
96
repositories {
107
mavenCentral()
8+
maven {
9+
url 'http://dl.bintray.com/kotlin/kotlin-eap'
10+
}
1111
}
1212
dependencies {
1313
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
14-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
15-
classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}")
14+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15+
classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlin_version}")
1616
}
1717
}
1818

19+
group 'org.pedrofelix'
20+
version '1.0-SNAPSHOT'
21+
22+
apply plugin: 'java'
1923
apply plugin: 'kotlin'
24+
// for Spring Boot
2025
apply plugin: 'kotlin-spring'
2126
apply plugin: 'eclipse'
2227
apply plugin: 'org.springframework.boot'
2328
apply plugin: 'io.spring.dependency-management'
2429

25-
compileKotlin {
26-
kotlinOptions {
27-
freeCompilerArgs = ["-Xjsr305=strict"]
28-
jvmTarget = "1.8"
29-
}
30-
}
31-
compileTestKotlin {
32-
kotlinOptions {
33-
freeCompilerArgs = ["-Xjsr305=strict"]
34-
jvmTarget = "1.8"
35-
}
36-
}
37-
38-
kotlin {
39-
experimental {
40-
coroutines 'enable'
41-
}
42-
}
30+
sourceCompatibility = 1.8
4331

4432
repositories {
4533
mavenCentral()
46-
jcenter()
34+
maven {
35+
url 'https://dl.bintray.com/kotlin/kotlinx/'
36+
}
4737
}
4838

4939
dependencies {
50-
compile "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:${kotlinVersion}"
51-
compile('org.springframework.boot:spring-boot-starter-web')
52-
buildscript {
53-
ext {
54-
kotlin_version = '1.3.0'
55-
springBootVersion = '2.1.0.RELEASE'
56-
}
57-
repositories {
58-
mavenCentral()
59-
maven {
60-
url 'http://dl.bintray.com/kotlin/kotlin-eap'
61-
}
62-
}
63-
dependencies {
64-
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
65-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
66-
classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlin_version}")
67-
}
68-
}
69-
70-
group 'org.pedrofelix'
71-
version '1.0-SNAPSHOT'
72-
73-
apply plugin: 'java'
74-
apply plugin: 'kotlin'
75-
// for Spring Boot
76-
apply plugin: 'kotlin-spring'
77-
apply plugin: 'eclipse'
78-
apply plugin: 'org.springframework.boot'
79-
apply plugin: 'io.spring.dependency-management'
80-
81-
sourceCompatibility = 1.8
82-
83-
repositories {
84-
mavenCentral()
85-
maven {
86-
url 'https://dl.bintray.com/kotlin/kotlinx/'
87-
}
88-
}
89-
90-
dependencies {
91-
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
92-
compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: '1.0.0'
93-
compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-slf4j', version: '1.0.0'
94-
compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-jdk8', version: '1.0.0'
95-
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
96-
compile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.1.4'
97-
compile group: 'com.fasterxml.jackson.module', name:'jackson-module-kotlin', version: '2.9.7'
98-
compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect'
99-
//compile("org.springframework.boot:spring-boot-starter-undertow") {
100-
// exclude module: "spring-boot-starter-logging"
101-
// exclude module: "logback-classic"
102-
//}
103-
compile("org.springframework.boot:spring-boot-starter-web") {
104-
exclude module: "spring-boot-starter-logging"
105-
exclude module: "logback-classic"
106-
//exclude module: "spring-boot-starter-tomcat"
107-
}
108-
testCompile group: 'junit', name: 'junit', version: '4.12'
109-
compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
40+
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
41+
compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: '1.0.0'
42+
compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-slf4j', version: '1.0.0'
43+
compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-jdk8', version: '1.0.0'
44+
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
45+
compile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.1.4'
46+
compile group: 'com.fasterxml.jackson.module', name:'jackson-module-kotlin', version: '2.9.7'
47+
compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect'
48+
//compile("org.springframework.boot:spring-boot-starter-undertow") {
49+
// exclude module: "spring-boot-starter-logging"
50+
// exclude module: "logback-classic"
51+
//}
52+
compile("org.springframework.boot:spring-boot-starter-web") {
53+
exclude module: "spring-boot-starter-logging"
54+
exclude module: "logback-classic"
55+
//exclude module: "spring-boot-starter-tomcat"
11056
}
57+
testCompile group: 'junit', name: 'junit', version: '4.12'
58+
compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
59+
}
11160

112-
compileKotlin {
113-
kotlinOptions.jvmTarget = "1.8"
114-
}
115-
compileTestKotlin {
116-
kotlinOptions.jvmTarget = "1.8"
117-
}
118-
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
119-
// runtime group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
120-
testCompile 'junit:junit:4.12'
61+
compileKotlin {
62+
kotlinOptions.jvmTarget = "1.8"
12163
}
64+
compileTestKotlin {
65+
kotlinOptions.jvmTarget = "1.8"
66+
}

0 commit comments

Comments
 (0)