Skip to content

Commit

Permalink
[BAEL-19882] - Move articles out of core-kotlin part1
Browse files Browse the repository at this point in the history
  • Loading branch information
catalin-burcea committed Dec 13, 2019
1 parent 3517462 commit a141ac0
Show file tree
Hide file tree
Showing 42 changed files with 210 additions and 124 deletions.
2 changes: 0 additions & 2 deletions core-kotlin-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,5 @@ This module contains articles about core Kotlin.
- [Kotlin Scope Functions](https://www.baeldung.com/kotlin-scope-functions)
- [Kotlin Annotations](https://www.baeldung.com/kotlin-annotations)
- [Split a List into Parts in Kotlin](https://www.baeldung.com/kotlin-split-list-into-parts)
- [String Comparison in Kotlin](https://www.baeldung.com/kotlin-string-comparison)
- [Guide to JVM Platform Annotations in Kotlin](https://www.baeldung.com/kotlin-jvm-annotations)
- [Finding an Element in a List Using Kotlin](https://www.baeldung.com/kotlin-finding-element-in-list)
- More articles: [[<-- prev]](/core-kotlin)
11 changes: 0 additions & 11 deletions core-kotlin-io/.gitignore

This file was deleted.

97 changes: 0 additions & 97 deletions core-kotlin-io/pom.xml

This file was deleted.

5 changes: 5 additions & 0 deletions core-kotlin-modules/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Core Kotlin

This module contains articles about core Kotlin.


8 changes: 8 additions & 0 deletions core-kotlin-modules/core-kotlin-annotations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Core Kotlin Annotations

This module contains articles about core Kotlin annotations.

### Relevant articles:
- [Kotlin Annotations](https://www.baeldung.com/kotlin-annotations)
- [Guide to Kotlin @JvmField](https://www.baeldung.com/kotlin-jvm-field-annotation)
- [Guide to JVM Platform Annotations in Kotlin](https://www.baeldung.com/kotlin-jvm-annotations)
41 changes: 41 additions & 0 deletions core-kotlin-modules/core-kotlin-annotations/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>core-kotlin-annotations</artifactId>
<name>core-kotlin-annotations</name>
<packaging>jar</packaging>

<parent>
<groupId>com.baeldung.core-kotlin-modules</groupId>
<artifactId>core-kotlin-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<properties>
<kotlin.version>1.3.30</kotlin.version>
<assertj.version>3.10.0</assertj.version>
</properties>

</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.kotlin
package com.baeldung.jvmfield

class JvmSample(text:String) {
@JvmField
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.kotlin
package com.baeldung.jvmfield

import org.junit.Before
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This module contains articles about core Kotlin I/O.

### Relevant articles:

- [InputStream to String in Kotlin](https://www.baeldung.com/kotlin-inputstream-to-string)
- [Console I/O in Kotlin](https://www.baeldung.com/kotlin-console-io)

- [Reading from a File in Kotlin](https://www.baeldung.com/kotlin-read-file)
- [Writing to a File in Kotlin](https://www.baeldung.com/kotlin-write-file)
54 changes: 54 additions & 0 deletions core-kotlin-modules/core-kotlin-io/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>core-kotlin-io</artifactId>
<name>core-kotlin-io</name>
<packaging>jar</packaging>

<parent>
<groupId>com.baeldung.core-kotlin-modules</groupId>
<artifactId>core-kotlin-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<properties>
<junit-jupiter.version>5.4.2</junit-jupiter.version>
<mockito.version>2.27.0</mockito.version>
<assertj.version>3.10.0</assertj.version>
</properties>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import java.io.File
import kotlin.test.assertEquals

class InputStreamToStringTest {

private val fileName = "src/test/resources/inputstream2string.txt"
private val endOfLine = System.lineSeparator()
private val fileFullContent = "Computer programming can be a hassle$endOfLine" +
Expand All @@ -19,6 +20,7 @@ class InputStreamToStringTest {
val content = inputStream.bufferedReader().use(BufferedReader::readText)
assertEquals(fileFullContent, content)
}

@Test
fun whenReadFileWithBufferedReaderReadText_thenFullFileContentIsReadAsString() {
val file = File(fileName)
Expand All @@ -32,6 +34,7 @@ class InputStreamToStringTest {
}
assertEquals(fileFullContent, content)
}

@Test
fun whenReadFileWithBufferedReaderManually_thenFullFileContentIsReadAsString() {
val file = File(fileName)
Expand Down Expand Up @@ -67,6 +70,5 @@ class InputStreamToStringTest {
assertEquals(fileFullContent, content)
}


}

File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions core-kotlin-modules/core-kotlin-strings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Core Kotlin Strings

This module contains articles about core Kotlin strings.

### Relevant articles:
- [Generate a Random Alphanumeric String in Kotlin](https://www.baeldung.com/kotlin-random-alphanumeric-string)
- [String Comparison in Kotlin](https://www.baeldung.com/kotlin-string-comparison)
- [Concatenate Strings in Kotlin](https://www.baeldung.com/kotlin-concatenate-strings)
- [Kotlin String Templates](https://www.baeldung.com/kotlin-string-template)
24 changes: 24 additions & 0 deletions core-kotlin-modules/core-kotlin-strings/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>core-kotlin-strings</artifactId>
<name>core-kotlin-strings</name>
<packaging>jar</packaging>

<parent>
<groupId>com.baeldung.core-kotlin-modules</groupId>
<artifactId>core-kotlin-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package com.baeldung.randomstring

import org.apache.commons.lang3.RandomStringUtils
import org.junit.Before
import org.junit.jupiter.api.BeforeAll
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package stringcomparison
package com.baeldung.stringcomparison

import org.junit.Test
import kotlin.test.assertFalse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.kotlin
package com.baeldung.stringconcatenation

import org.junit.Test
import kotlin.test.assertEquals
Expand Down
56 changes: 56 additions & 0 deletions core-kotlin-modules/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung.core-kotlin-modules</groupId>
<artifactId>core-kotlin-modules</artifactId>
<name>core-kotlin-modules</name>
<packaging>pom</packaging>

<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-kotlin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../parent-kotlin</relativePath>
</parent>

<modules>
<module>core-kotlin-annotations</module>
<module>core-kotlin-io</module>
<module>core-kotlin-strings</module>
</modules>

<build>
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<jvmTarget>1.8</jvmTarget>
</configuration>
</plugin>
</plugins>
</build>

<properties>
<kotlin.version>1.3.30</kotlin.version>
</properties>

</project>
Loading

0 comments on commit a141ac0

Please sign in to comment.