Skip to content

Commit

Permalink
Merge branch 'release/v3.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mplatvoet committed Feb 15, 2016
2 parents 9d25a66 1feb894 commit c37bd27
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 52 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 17,13 @@ task { "world" } and task { "Hello" } success {
Please refer to the [Kovenant](http://kovenant.komponents.nl) site for API usage and more.

## Getting started
Build against Kotlin 1.0 rc: `1.0.0-rc-1036`.
Build against Kotlin: `1.0.0`.
Source and target compatibility is `1.6`

###Gradle
```groovy
dependencies {
compile 'nl.komponents.kovenant:kovenant:3.0.0-rc.1036.1'
compile 'nl.komponents.kovenant:kovenant:3.0.0'
}
```

Expand All @@ -32,7 32,7 @@ dependencies {
<dependency>
<groupId>nl.komponents.kovenant</groupId>
<artifactId>kovenant</artifactId>
<version>3.0.0-rc.1036.1</version>
<version>3.0.0</version>
</dependency>
```

Expand Down
25 changes: 3 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 20,7 @@
*/

buildscript {
ext.kotlinVersion = '1.0.0-rc-1036'
ext.kotlinVersion = '1.0.0'
ext.extraConfVersion = '2.2. '

repositories {
Expand All @@ -38,7 38,7 @@ buildscript {

allprojects {
ext {
appVersion = '3.0.0-rc.1036.1'
appVersion = '3.0.0'
appGroup = 'nl.komponents.kovenant'


Expand Down Expand Up @@ -206,24 206,5 @@ task release() {
dependsOn subprojects.uploadArchives
}

task wrapper(type: Wrapper) {
gradleVersion = '2.10'

doLast() {
def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
File wrapperFile = file("gradlew")
wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
File wrapperBatFile = file("gradlew.bat")
wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
}
}




defaultTasks 'clean', 'jars'


defaultTasks 'clean', 'jars'
5 changes: 5 additions & 0 deletions docs/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 3,11 @@
Changelog of Kovenant. Complying to [Semantic Versioning](http://semver.org).
Please refer to [roadmap](roadmap.md) for upcoming releases.

##v3.0.0

**general**

* Kotlin 1.0

##v3.0.0-rc.1036.1

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 25,13 @@ Developed with the following [goals](misc/goals.md) in mind.
* **Dependency free**: when not counting kotlin std

## Getting started
Build against Kotlin 1.0 rc: `1.0.0-rc-1036`.
Build against Kotlin: `1.0.0`.
Source and target compatibility is `1.6`

###Gradle
```groovy
dependencies {
compile 'nl.komponents.kovenant:kovenant:3.0.0-rc.1036.1'
compile 'nl.komponents.kovenant:kovenant:3.0.0'
}
```

Expand All @@ -40,7 40,7 @@ dependencies {
<dependency>
<groupId>nl.komponents.kovenant</groupId>
<artifactId>kovenant</artifactId>
<version>3.0.0-rc.1036.1</version>
<version>3.0.0</version>
</dependency>
```

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
#Tue Dec 29 15:45:44 CET 2015
#Wed Feb 10 09:42:39 CET 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-all.zip
1 change: 0 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 7,6 @@
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
GRADLE_OPTS="-XX:MaxMetaspaceSize=1024m -Xmx1024m $GRADLE_OPTS"
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
Expand Down
3 changes: 1 addition & 2 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 9,6 @@
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set GRADLE_OPTS=-XX:MaxMetaspaceSize=1024m -Xmx1024m -XX:MaxHeapSize=256m %GRADLE_OPTS%
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
Expand Down Expand Up @@ -47,7 46,7 @@ echo location of your Java installation.
goto fail

:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2 2]" == "4" goto 4NT_args
Expand Down
2 changes: 1 addition & 1 deletion projects/progress/progress.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 24,5 @@ project.description = "Progress tracking Kovenant extensions"

dependencies {
compile project(':kovenant-core')
compile 'nl.komponents.progress:progress-core:1.0.0-rc.1036'
compile 'nl.komponents.progress:progress-core:1.0.0'
}
2 changes: 1 addition & 1 deletion projects/ui/src/main/kotlin/cache-jvm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 35,7 @@ import java.util.concurrent.atomic.AtomicReference
*
* Not fully documented yet as this might change in the future
*/
public class WeakReferenceCache<K : Any, V : Any>(private val factory: (K) -> V) {
class WeakReferenceCache<K : Any, V : Any>(private val factory: (K) -> V) {
private val head = AtomicReference<CacheNode<K, V>>(null)

/**
Expand Down
9 changes: 4 additions & 5 deletions projects/ui/src/main/kotlin/callbacks-api.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 23,10 @@ package nl.komponents.kovenant.ui

import nl.komponents.kovenant.*

@JvmOverloads
public fun <V> promiseOnUi(uiContext: UiContext = KovenantUi.uiContext,
context: Context = Kovenant.context,
alwaysSchedule: Boolean = false,
body: () -> V): Promise<V, Exception> {
@JvmOverloads fun <V> promiseOnUi(uiContext: UiContext = KovenantUi.uiContext,
context: Context = Kovenant.context,
alwaysSchedule: Boolean = false,
body: () -> V): Promise<V, Exception> {
if (directExecutionAllowed(alwaysSchedule, uiContext.dispatcher)) {
return try {
Promise.ofSuccess(context = context, value = body())
Expand Down
18 changes: 9 additions & 9 deletions projects/ui/src/main/kotlin/context-api.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,42 26,42 @@ import nl.komponents.kovenant.Dispatcher
import nl.komponents.kovenant.DispatcherContext


public object KovenantUi {
object KovenantUi {
private val concrete = ConcreteUiKovenant()
public var uiContext: UiContext
var uiContext: UiContext
get() = concrete.uiContext
set(value) {
concrete.uiContext = value
}

public fun uiContext(body: MutableUiContext.() -> Unit): UiContext = concrete.uiContext(body)
fun uiContext(body: MutableUiContext.() -> Unit): UiContext = concrete.uiContext(body)

public fun createUiContext(body: MutableUiContext.() -> Unit): UiContext = concrete.createUiContext(body)
fun createUiContext(body: MutableUiContext.() -> Unit): UiContext = concrete.createUiContext(body)

}

public fun UiContext.dispatcherContextFor(context: Context): DispatcherContext {
fun UiContext.dispatcherContextFor(context: Context): DispatcherContext {
return dispatcherContextBuilder(dispatcher, context)
}

public interface UiContext {
interface UiContext {
val dispatcher: Dispatcher
val dispatcherContextBuilder: (Dispatcher, Context) -> DispatcherContext
}

public interface MutableUiContext : UiContext {
interface MutableUiContext : UiContext {
override var dispatcher: Dispatcher
override var dispatcherContextBuilder: (Dispatcher, Context) -> DispatcherContext
}

public interface ReconfigurableUiContext : MutableUiContext {
interface ReconfigurableUiContext : MutableUiContext {
fun copy(): ReconfigurableUiContext
}

/**
* Undocumented, may change in the future
*/
public class DelegatingDispatcherContext(private val base: DispatcherContext,
class DelegatingDispatcherContext(private val base: DispatcherContext,
override val dispatcher: Dispatcher) : DispatcherContext {
override val errorHandler: (Exception) -> Unit
get() = base.errorHandler
Expand Down
6 changes: 3 additions & 3 deletions projects/ui/src/main/kotlin/context-jvm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 44,7 @@ class ConcreteUiKovenant {
throw ConfigurationException("Current UiContext [$ctx] does not implement ReconfigurableUiContext and therefor can't be reconfigured.")
}

public fun uiContext(body: MutableUiContext.() -> Unit): UiContext {
fun uiContext(body: MutableUiContext.() -> Unit): UiContext {
//a copy-on-write strategy is used, but in order to maintain the lazy loading mechanism
//keeping track of what the developer actually altered is needed, otherwise
//everything gets initialized during configuration
Expand Down Expand Up @@ -126,15 126,15 @@ class ConcreteUiKovenant {
/**
* Build a default DispatcherContext builder. Not part of documented API (yet). Might change in the future.
*/
public fun defaultDispatcherContextBuilder(): (Dispatcher, Context) -> DispatcherContext
fun defaultDispatcherContextBuilder(): (Dispatcher, Context) -> DispatcherContext
= cachedDispatcherContextBuilder { dispatcher, context -> DelegatingDispatcherContext(context.callbackContext, dispatcher) }


/**
* Build a cached DispatcherContext builder with the supplied factory method. Not part of documented API (yet).
* Might change in the future.
*/
public fun cachedDispatcherContextBuilder(factory: (Dispatcher, Context) -> DispatcherContext): (Dispatcher, Context) -> DispatcherContext {
fun cachedDispatcherContextBuilder(factory: (Dispatcher, Context) -> DispatcherContext): (Dispatcher, Context) -> DispatcherContext {
val cache = WeakReferenceCache<Dispatcher, WeakReferenceCache<Context, DispatcherContext>>() {
dispatcher ->
WeakReferenceCache<Context, DispatcherContext>() {
Expand Down

0 comments on commit c37bd27

Please sign in to comment.