Skip to content

Commit

Permalink
Merge pull request #70 from mipt-npm/dev
Browse files Browse the repository at this point in the history
0.5.0
  • Loading branch information
altavir authored Aug 13, 2021
2 parents 32b986f + ce8074c commit acfe9c2
Show file tree
Hide file tree
Showing 129 changed files with 2,998 additions and 4,041 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
name: Gradle build

on: [ push ]
on:
push:
branches: [ dev, master ]
pull_request:

jobs:
build:
strategy:
matrix:
os: [ macOS-latest, windows-latest ]
runs-on: ${{matrix.os}}
timeout-minutes: 40
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
uses: DeLaGuardo/setup-[email protected]
with:
java-version: 11
- name: Add msys to path
if: matrix.os == 'windows-latest'
run: SETX PATH "%PATH%;C:\msys64\mingw64\bin"
graalvm: 21.2.0
java: java11
arch: amd64
- name: Cache gradle
uses: actions/cache@v2
with:
path: ~/.gradle/caches
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
Expand All @@ -33,4 +38,4 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Build
run: ./gradlew build --no-daemon --stacktrace
run: ./gradlew build --build-cache --no-daemon --stacktrace
29 changes: 12 additions & 17 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,27 @@ name: Dokka publication

on:
push:
branches:
- master
branches: [ master ]

jobs:
build:
runs-on: ubuntu-20.04
timeout-minutes: 40
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v2
- uses: DeLaGuardo/[email protected]
with:
java-version: 11
- name: Cache gradle
uses: actions/cache@v2
graalvm: 21.2.0
java: java11
arch: amd64
- uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ubuntu-20.04-gradle-${{ hashFiles('*.gradle.kts') }}
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
ubuntu-20.04-gradle-
- name: Build
run: |
./gradlew dokkaHtmlMultiModule --no-daemon --no-parallel --stacktrace
mv build/dokka/htmlMultiModule/-modules.html build/dokka/htmlMultiModule/index.html
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
${{ runner.os }}-gradle-
- run: ./gradlew dokkaHtmlMultiModule --build-cache --no-daemon --no-parallel --stacktrace
- uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: build/dokka/htmlMultiModule
38 changes: 16 additions & 22 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@ name: Gradle publish
on:
workflow_dispatch:
release:
types:
- created
types: [ created ]

jobs:
publish:
environment:
name: publish
strategy:
matrix:
os: [macOS-latest, windows-latest]
os: [ macOS-latest, windows-latest ]
runs-on: ${{matrix.os}}
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
uses: DeLaGuardo/setup-[email protected]
with:
java-version: 11
- name: Add msys to path
if: matrix.os == 'windows-latest'
run: SETX PATH "%PATH%;C:\msys64\mingw64\bin"
graalvm: 21.2.0
java: java11
arch: amd64
- name: Cache gradle
uses: actions/cache@v2
with:
path: ~/.gradle/caches
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
Expand All @@ -40,20 +40,14 @@ jobs:
${{ runner.os }}-gradle-
- name: Publish Windows Artifacts
if: matrix.os == 'windows-latest'
shell: cmd
run: >
./gradlew release --no-daemon
-Ppublishing.enabled=true
-Ppublishing.github.user=${{ secrets.PUBLISHING_GITHUB_USER }}
-Ppublishing.github.token=${{ secrets.PUBLISHING_GITHUB_TOKEN }}
-Ppublishing.space.user=${{ secrets.PUBLISHING_SPACE_USER }}
-Ppublishing.space.token=${{ secrets.PUBLISHING_SPACE_TOKEN }}
./gradlew release --no-daemon --build-cache -Ppublishing.enabled=true
-Ppublishing.space.user=${{ secrets.SPACE_APP_ID }}
-Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }}
- name: Publish Mac Artifacts
if: matrix.os == 'macOS-latest'
run: >
./gradlew release --no-daemon
-Ppublishing.enabled=true
-Ppublishing.platform=macosX64
-Ppublishing.github.user=${{ secrets.PUBLISHING_GITHUB_USER }}
-Ppublishing.github.token=${{ secrets.PUBLISHING_GITHUB_TOKEN }}
-Ppublishing.space.user=${{ secrets.PUBLISHING_SPACE_USER }}
-Ppublishing.space.token=${{ secrets.PUBLISHING_SPACE_TOKEN }}
./gradlew release --no-daemon --build-cache -Ppublishing.enabled=true -Ppublishing.platform=macosX64
-Ppublishing.space.user=${{ secrets.SPACE_APP_ID }}
-Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }}
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,31 @@

### Fixed

### Security
## [0.5.0]
### Added
- Experimental `listOfSpec` delegate.

### Changed
- **API breaking** Config is deprecated, use `ObservableMeta` instead.
- **API breaking** Descriptor no has a member property `defaultValue` instead of `defaultItem()` extension. It caches default value state on the first call. It is done because computing default on each call is too expensive.
- Kotlin 1.5.10
- Build tools 0.10.0
- Relaxed type restriction on `MetaConverter`. Now nullables are available.
- **Huge API-breaking refactoring of Meta**. Meta now can have both value and children. There is only one kind of descriptor now.
- **API breaking** `String.toName()` is replaced by `Name.parse()`
- **API breaking** Configurable`config` changed to `meta`

### Removed
- `Config`
- Public PluginManager mutability
- Tables and tables-exposed moved to the separate project `tables.kt`
- BinaryMetaFormat. Use CBOR encoding instead

### Fixed
- Proper json array index treatment.
- Proper json index for single-value array.

### Security
## [0.4.0]
### Added
Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@
> **Maturity**: PROTOTYPE
<hr/>
* ### [dataforge-tables](dataforge-tables)
>
>
> **Maturity**: PROTOTYPE
<hr/>
* ### [dataforge-workspace](dataforge-workspace)
>
>
Expand Down
6 changes: 1 addition & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

allprojects {
group = "space.kscience"
version = "0.4.0"
version = "0.5.0"
}

subprojects {
Expand All @@ -15,10 +15,6 @@ readme {
readmeTemplate = file("docs/templates/README-TEMPLATE.md")
}

changelog{
version = project.version.toString()
}

ksciencePublish {
github("dataforge-core")
space("https://maven.pkg.jetbrains.space/mipt-npm/p/sci/maven")
Expand Down
28 changes: 0 additions & 28 deletions dataforge-context/api/dataforge-context.api
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,6 @@ public final class space/kscience/dataforge/context/PluginFactory$Companion {
}

public final class space/kscience/dataforge/context/PluginManager : java/lang/Iterable, kotlin/jvm/internal/markers/KMappedMarker, space/kscience/dataforge/context/ContextAware {
public fun <init> (Lspace/kscience/dataforge/context/Context;)V
public final fun fetch (Lspace/kscience/dataforge/context/PluginFactory;Lspace/kscience/dataforge/meta/Meta;Z)Lspace/kscience/dataforge/context/Plugin;
public final fun fetch (Lspace/kscience/dataforge/context/PluginFactory;ZLkotlin/jvm/functions/Function1;)Lspace/kscience/dataforge/context/Plugin;
public static synthetic fun fetch$default (Lspace/kscience/dataforge/context/PluginManager;Lspace/kscience/dataforge/context/PluginFactory;Lspace/kscience/dataforge/meta/Meta;ZILjava/lang/Object;)Lspace/kscience/dataforge/context/Plugin;
public static synthetic fun fetch$default (Lspace/kscience/dataforge/context/PluginManager;Lspace/kscience/dataforge/context/PluginFactory;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lspace/kscience/dataforge/context/Plugin;
public final fun find (ZLkotlin/jvm/functions/Function1;)Lspace/kscience/dataforge/context/Plugin;
public static synthetic fun find$default (Lspace/kscience/dataforge/context/PluginManager;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lspace/kscience/dataforge/context/Plugin;
public final fun get (Lkotlin/reflect/KClass;Lspace/kscience/dataforge/context/PluginTag;Z)Ljava/lang/Object;
Expand All @@ -178,7 +173,6 @@ public final class space/kscience/dataforge/context/PluginManager : java/lang/It
public fun getContext ()Lspace/kscience/dataforge/context/Context;
public fun iterator ()Ljava/util/Iterator;
public final fun list (Z)Ljava/util/Collection;
public final fun remove (Lspace/kscience/dataforge/context/Plugin;)V
}

public final class space/kscience/dataforge/context/PluginTag : space/kscience/dataforge/meta/MetaRepr {
Expand Down Expand Up @@ -228,28 +222,6 @@ public final class space/kscience/dataforge/context/SlfLogManager$Companion : sp
public fun invoke (Lspace/kscience/dataforge/meta/Meta;Lspace/kscience/dataforge/context/Context;)Lspace/kscience/dataforge/context/SlfLogManager;
}

public abstract interface annotation class space/kscience/dataforge/descriptors/Attribute : java/lang/annotation/Annotation {
public abstract fun key ()Ljava/lang/String;
public abstract fun value ()Ljava/lang/String;
}

public abstract interface annotation class space/kscience/dataforge/descriptors/Attributes : java/lang/annotation/Annotation {
public abstract fun attrs ()[Lspace/kscience/dataforge/descriptors/Attribute;
}

public abstract interface annotation class space/kscience/dataforge/descriptors/ItemDef : java/lang/annotation/Annotation {
public abstract fun info ()Ljava/lang/String;
public abstract fun multiple ()Z
public abstract fun required ()Z
}

public abstract interface annotation class space/kscience/dataforge/descriptors/ValueDef : java/lang/annotation/Annotation {
public abstract fun allowed ()[Ljava/lang/String;
public abstract fun def ()Ljava/lang/String;
public abstract fun enumeration ()Ljava/lang/Class;
public abstract fun type ()[Lspace/kscience/dataforge/values/ValueType;
}

public final class space/kscience/dataforge/properties/PropertyKt {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ package space.kscience.dataforge.context
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
import space.kscience.dataforge.meta.Laminate
import space.kscience.dataforge.meta.Meta
import space.kscience.dataforge.meta.MetaRepr
import space.kscience.dataforge.meta.itemSequence
import space.kscience.dataforge.meta.*
import space.kscience.dataforge.misc.Named
import space.kscience.dataforge.names.Name
import space.kscience.dataforge.provider.Provider
Expand All @@ -26,6 +23,7 @@ import kotlin.jvm.Synchronized
public open class Context internal constructor(
final override val name: Name,
public val parent: Context?,
plugins: Set<Plugin>, // set of unattached plugins
meta: Meta,
) : Named, MetaRepr, Provider, CoroutineScope {

Expand All @@ -42,20 +40,20 @@ public open class Context internal constructor(
/**
* A [PluginManager] for current context
*/
public val plugins: PluginManager by lazy { PluginManager(this) }
public val plugins: PluginManager by lazy { PluginManager(this, plugins) }

override val defaultTarget: String get() = Plugin.TARGET

public fun content(target: String, inherit: Boolean): Map<Name, Any> {
return if (inherit) {
when (target) {
PROPERTY_TARGET -> properties.itemSequence().toMap()
PROPERTY_TARGET -> properties.nodeSequence().toMap()
Plugin.TARGET -> plugins.list(true).associateBy { it.name }
else -> emptyMap()
}
} else {
when (target) {
PROPERTY_TARGET -> properties.layers.firstOrNull()?.itemSequence()?.toMap() ?: emptyMap()
PROPERTY_TARGET -> properties.layers.firstOrNull()?.nodeSequence()?.toMap() ?: emptyMap()
Plugin.TARGET -> plugins.list(false).associateBy { it.name }
else -> emptyMap()
}
Expand Down Expand Up @@ -97,8 +95,8 @@ public open class Context internal constructor(

override fun toMeta(): Meta = Meta {
"parent" to parent?.name
"properties" put properties.layers.firstOrNull()
"plugins" put plugins.map { it.toMeta() }
properties.layers.firstOrNull()?.let { set("properties", it) }
"plugins" putIndexed plugins.map { it.toMeta() }
}

public companion object {
Expand Down
Loading

0 comments on commit acfe9c2

Please sign in to comment.