Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Commit

Permalink
Migrated from korlibs, nmpp and badges
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz committed Oct 14, 2018
1 parent dd99343 commit 47a04a2
Show file tree
Hide file tree
Showing 39 changed files with 518 additions and 305 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -3,4 +3,7 @@
/build
/out
/classes
/web
/web
*.ipr
*.iws
*.iml
67 changes: 43 additions & 24 deletions .travis.yml
@@ -1,25 +1,44 @@
language: java
matrix:
include:
- os: linux
language: java
jdk: oraclejdk8
env: KBUILD=linux
install:
- nvm install 8
- nvm use 8
- node --version
- npm -g install mocha
- which node
- which mocha
script:
- ./gradlew -s -i check build
- os: windows
env: KBUILD=windows
language: shell # java is not supported but jdk is installed
script:
- powershell -Command "cmd /c travis_win.bat"
- os: osx
env: KBUILD=macos
language: java
jdk: oraclejdk8
install:
- nvm install 8
- nvm use 8
- node --version
- npm -g install mocha
- which node
- which mocha
script:
- ./gradlew -s -i check build

jdk:
- oraclejdk8

install:
- nvm install 8
- nvm use 8
- node --version
- npm -g install mocha
- which node
- which mocha

script:
- jdk_switcher use oraclejdk8
#- ./gradlew -s -i check install distJs
- ./gradlew -s -i check install

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock

cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
#before_cache:
# - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
# - rm -f $HOME/.gradle-linux/caches/modules-2/modules-2.lock
# - rm -f $HOME/.gradle-win/caches/modules-2/modules-2.lock
#
#cache:
# directories:
# - $HOME/.gradle/caches/
# - $HOME/.gradle/wrapper/
# - $HOME/.konan
30 changes: 0 additions & 30 deletions LICENSE
Expand Up @@ -19,33 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

----------------------------------

Some parts of the api and date algorithms come from .NET DateTime implementation released under MIT license

https://github.com/dotnet/coreclr/blob/d780f9a1327344bfc8e06737497b703cdbfba804/src/mscorlib/shared/System/DateTime.cs

The MIT License (MIT)

Copyright (c) .NET Foundation and Contributors

All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 5 additions & 1 deletion README.md
@@ -1 +1,5 @@
# klogger
# Logger for Kotlin JVM, JS, Native and Common

[![Build Status](https://travis-ci.org/korlibs/klogger.svg?branch=master)](https://travis-ci.org/korlibs/klogger)
[![Maven Version](https://img.shields.io/github/tag/korlibs/klogger.svg?style=flat&label=maven)](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22klogger%22)
[![Gitter](https://img.shields.io/gitter/room/korlibs/korlibs.svg)](https://gitter.im/korlibs/Lobby)
203 changes: 176 additions & 27 deletions build.gradle
@@ -1,27 +1,176 @@
buildscript {
ext.projectVersion = '0.5.1-SNAPSHOT'
ext.projectName = 'klogger'
ext.projectGroup = 'com.soywiz'
ext.projectDesc = 'Klogger: Consistent and portable logger library for multiplatform kotlin'
ext.projectHost = 'github'
ext.projectOrg = 'korlibs'
ext.projectLicense = 'MIT'
ext.projectDevelNick = 'soywiz'
ext.projectDevelName = 'Carlos Ballesteros Velasco'
ext.projectInceptionYear = 2017

ext.kotlinVersion = '1.2.20'

repositories {
mavenLocal()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "gradle.plugin.com.soywiz:korlibs-build-gradle-plugin:0.1.7"
}
}

apply plugin: 'com.soywiz.korlibs-build-gradle-plugin'
plugins {
id 'kotlin-multiplatform' version '1.3.0-rc-146'
id 'com.moowork.node' version '1.2.0'
}

repositories {
mavenLocal()
jcenter()
maven { url "https://dl.bintray.com/soywiz/soywiz" }
maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
maven { url "https://dl.bintray.com/kotlin/kotlinx" }
}

kotlin {
targets {
fromPreset(presets.iosX64, 'iosX64')
fromPreset(presets.iosArm32, 'iosArm32')
fromPreset(presets.iosArm64, 'iosArm64')
fromPreset(presets.macosX64, 'macosX64')
fromPreset(presets.linuxX64, 'linuxX64')
fromPreset(presets.mingwX64, 'mingwX64')
fromPreset(presets.jvm, 'jvm')
fromPreset(presets.js, 'js') {
compilations.main {
compileKotlinJs.kotlinOptions {
languageVersion = "1.3"
sourceMap = true
metaInfo = true
moduleKind = "umd"
}
compileTestKotlinJs.kotlinOptions {
languageVersion = "1.3"
moduleKind = "commonjs"
}
}
}
}
sourceSets {
nativeCommonMain
nativeCommonTest
nativePosixMain
mingwX64Main {
dependsOn nativeCommonMain
}
mingwX64Main {
dependsOn nativeCommonTest
}
configure([iosX64Main, iosArm32Main, iosArm64Main, macosX64Main, linuxX64Main]) {
dependsOn nativeCommonMain
dependsOn nativePosixMain
}
configure([iosX64Test, iosArm32Test, iosArm64Test, macosX64Test, linuxX64Test]) {
dependsOn nativeCommonTest
}
}
}

dependencies {
commonMainImplementation "org.jetbrains.kotlinx:atomicfu-common:$atomixfuVersion"
jvmMainImplementation "org.jetbrains.kotlinx:atomicfu:$atomixfuVersion"
jsMainImplementation "org.jetbrains.kotlinx:atomicfu-js:$atomixfuVersion"
linuxX64MainImplementation "org.jetbrains.kotlinx:atomicfu-native_debug_linux_x64:$atomixfuVersion"
mingwX64MainImplementation "org.jetbrains.kotlinx:atomicfu-native_debug_mingw_x64:$atomixfuVersion"
macosX64MainImplementation "org.jetbrains.kotlinx:atomicfu-native_debug_macos_x64:$atomixfuVersion"
iosX64MainImplementation "org.jetbrains.kotlinx:atomicfu-native_debug_ios_x64:$atomixfuVersion"
iosArm32MainImplementation "org.jetbrains.kotlinx:atomicfu-native_debug_ios_arm32:$atomixfuVersion"
iosArm64MainImplementation "org.jetbrains.kotlinx:atomicfu-native_debug_ios_arm64:$atomixfuVersion"

commonMainImplementation "org.jetbrains.kotlin:kotlin-stdlib-common"
commonTestImplementation "org.jetbrains.kotlin:kotlin-test-annotations-common"
commonTestImplementation "org.jetbrains.kotlin:kotlin-test-common"

jsMainImplementation "org.jetbrains.kotlin:kotlin-stdlib-js"
jsTestImplementation "org.jetbrains.kotlin:kotlin-test-js"

jvmMainImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
jvmTestImplementation "org.jetbrains.kotlin:kotlin-test"
jvmTestImplementation "org.jetbrains.kotlin:kotlin-test-junit"
}

// Javascript test configuration
node {
version = '8.11.4'
download = true
nodeModulesDir = file("$buildDir/yarn")
}

def jsCompilations = kotlin.targets.js.compilations
task addYarnDeps(type: YarnTask) {
doFirst {
mkdir "$buildDir/yarn"
}
args = ["add", "mocha@5.2.0"]
}

task populateNodeModules {
doLast {
copy {
from "$buildDir/yarn/node_modules"
from jsCompilations.main.output.first()
jsCompilations.test.runtimeDependencyFiles.each {
if (it.exists() && !it.isDirectory()) {
from zipTree(it.absolutePath).matching { include '*.js' }
}
}
into "$buildDir/node_modules"
}
}
}

task runMocha(type: NodeTask, dependsOn: [jsCompilations.test.compileKotlinTaskName, addYarnDeps, populateNodeModules]) {
script = file("$buildDir/node_modules/mocha/bin/mocha")
args = [relativePath("${jsCompilations.test.output.first()}/klogger_test.js")]
}

jsTest.dependsOn runMocha

// Fix for https://github.com/srs/gradle-node-plugin/issues/301
repositories.whenObjectAdded {
if (it instanceof IvyArtifactRepository) {
metadataSources {
artifact()
}
}
}

// Publishing
group 'com.soywiz'
version projectVersion
apply plugin: 'maven-publish'

def pomBaseData = {
licenses {
license {
name "MIT License"
url "https://raw.githubusercontent.com/korlibs/klogger/master/LICENSE"
}
}
scm {
url "https://github.com/korlibs/klogger"
}
}

def generatePom = { pom ->
pom.withXml {
def root = it.asNode()
root.appendNode('name', project.name)
root.appendNode('description', 'Consistent and portable date and time utilities for multiplatform kotlin (JVM, JS, Native and COMMON)')
root.appendNode('url', 'https://github.com/korlibs/klogger')
root.children().last() + pomBaseData
}
}

ext.generatePom = generatePom

def publishUser = rootProject.findProperty('BINTRAY_USER') ?: project.findProperty('bintrayUser') ?: System.getenv('BINTRAY_USER')
def publishPassword = rootProject.findProperty('BINTRAY_KEY') ?: project.findProperty('bintrayApiKey') ?: System.getenv('BINTRAY_API_KEY')

if (publishUser && publishPassword) {
publishing {
repositories {
maven {
credentials {
username publishUser
password publishPassword
}
url 'https://api.bintray.com/maven/soywiz/soywiz/korlibs/'
//url "https://api.bintray.com/content/soywiz/soywiz/korlibs/$projectVersion"
}
}

configure(publications) {
generatePom(pom)
}
}
}
4 changes: 4 additions & 0 deletions gradle.properties
@@ -0,0 +1,4 @@
projectVersion=0.9.0

atomixfuVersion=0.11.10-eap13
#atomixfuVersion=0.11.10-nmpp
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-bin.zip
8 changes: 8 additions & 0 deletions gradlew_linux
@@ -0,0 +1,8 @@
#!/bin/bash
docker run \
"-v$PWD:/work" \
"-v$HOME/.gradle-linux:/root/.gradle" \
"-v$HOME/.m2:/root/.m2" \
"-v$HOME/.konan:/root/.konan" \
soywiz/kotlin-native-win \
./gradlew $*
10 changes: 10 additions & 0 deletions gradlew_win
@@ -0,0 +1,10 @@
#!/bin/bash
HOME=`echo ~`

docker run -it \
"-v$PWD:/work" \
"-v$HOME/.gradle-win:/root/.wine/drive_c/users/root/.gradle" \
"-v$HOME/.m2:/root/.wine/drive_c/users/root/.m2" \
"-v$HOME/.konan:/root/.wine/drive_c/users/root/.konan" \
soywiz/kotlin-native-win \
winecmd gradlew.bat $*
2 changes: 2 additions & 0 deletions gradlew_wine
@@ -0,0 +1,2 @@
#!/bin/bash
WINEDEBUG=-all wine cmd /c gradlew.bat $*
6 changes: 0 additions & 6 deletions klogger/common/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions klogger/common/build.gradle

This file was deleted.

5 changes: 0 additions & 5 deletions klogger/common/src/main/kotlin/com/soywiz/klogger/Klogger.kt

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 47a04a2

Please sign in to comment.