Skip to content

Commit acfe9c2

Browse files
authored
Merge pull request #70 from mipt-npm/dev
0.5.0
2 parents 32b986f + ce8074c commit acfe9c2

File tree

129 files changed

+2998
-4041
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+2998
-4041
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
name: Gradle build
22

3-
on: [ push ]
3+
on:
4+
push:
5+
branches: [ dev, master ]
6+
pull_request:
47

58
jobs:
69
build:
710
strategy:
811
matrix:
912
os: [ macOS-latest, windows-latest ]
1013
runs-on: ${{matrix.os}}
14+
timeout-minutes: 40
1115
steps:
1216
- name: Checkout the repo
1317
uses: actions/checkout@v2
1418
- name: Set up JDK 11
15-
uses: actions/setup-java@v1
19+
uses: DeLaGuardo/setup-[email protected]
1620
with:
17-
java-version: 11
18-
- name: Add msys to path
19-
if: matrix.os == 'windows-latest'
20-
run: SETX PATH "%PATH%;C:\msys64\mingw64\bin"
21+
graalvm: 21.2.0
22+
java: java11
23+
arch: amd64
2124
- name: Cache gradle
2225
uses: actions/cache@v2
2326
with:
24-
path: ~/.gradle/caches
27+
path: |
28+
~/.gradle/caches
29+
~/.gradle/wrapper
2530
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
2631
restore-keys: |
2732
${{ runner.os }}-gradle-
@@ -33,4 +38,4 @@ jobs:
3338
restore-keys: |
3439
${{ runner.os }}-gradle-
3540
- name: Build
36-
run: ./gradlew build --no-daemon --stacktrace
41+
run: ./gradlew build --build-cache --no-daemon --stacktrace

.github/workflows/pages.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,27 @@ name: Dokka publication
22

33
on:
44
push:
5-
branches:
6-
- master
5+
branches: [ master ]
76

87
jobs:
98
build:
109
runs-on: ubuntu-20.04
10+
timeout-minutes: 40
1111
steps:
12-
- name: Checkout the repo
13-
uses: actions/checkout@v2
14-
- name: Set up JDK 11
15-
uses: actions/setup-java@v1
12+
- uses: actions/checkout@v2
13+
- uses: DeLaGuardo/[email protected]
1614
with:
17-
java-version: 11
18-
- name: Cache gradle
19-
uses: actions/cache@v2
15+
graalvm: 21.2.0
16+
java: java11
17+
arch: amd64
18+
- uses: actions/cache@v2
2019
with:
2120
path: ~/.gradle/caches
22-
key: ubuntu-20.04-gradle-${{ hashFiles('*.gradle.kts') }}
21+
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
2322
restore-keys: |
24-
ubuntu-20.04-gradle-
25-
- name: Build
26-
run: |
27-
./gradlew dokkaHtmlMultiModule --no-daemon --no-parallel --stacktrace
28-
mv build/dokka/htmlMultiModule/-modules.html build/dokka/htmlMultiModule/index.html
29-
- name: Deploy to GitHub Pages
30-
uses: JamesIves/[email protected]
23+
${{ runner.os }}-gradle-
24+
- run: ./gradlew dokkaHtmlMultiModule --build-cache --no-daemon --no-parallel --stacktrace
25+
- uses: JamesIves/[email protected]
3126
with:
3227
branch: gh-pages
3328
folder: build/dokka/htmlMultiModule

.github/workflows/publish.yml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@ name: Gradle publish
33
on:
44
workflow_dispatch:
55
release:
6-
types:
7-
- created
6+
types: [ created ]
87

98
jobs:
109
publish:
1110
environment:
1211
name: publish
1312
strategy:
1413
matrix:
15-
os: [macOS-latest, windows-latest]
14+
os: [ macOS-latest, windows-latest ]
1615
runs-on: ${{matrix.os}}
1716
steps:
1817
- name: Checkout the repo
1918
uses: actions/checkout@v2
2019
- name: Set up JDK 11
21-
uses: actions/setup-java@v1
20+
uses: DeLaGuardo/setup-[email protected]
2221
with:
23-
java-version: 11
24-
- name: Add msys to path
25-
if: matrix.os == 'windows-latest'
26-
run: SETX PATH "%PATH%;C:\msys64\mingw64\bin"
22+
graalvm: 21.2.0
23+
java: java11
24+
arch: amd64
2725
- name: Cache gradle
2826
uses: actions/cache@v2
2927
with:
30-
path: ~/.gradle/caches
28+
path: |
29+
~/.gradle/caches
30+
~/.gradle/wrapper
3131
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
3232
restore-keys: |
3333
${{ runner.os }}-gradle-
@@ -40,20 +40,14 @@ jobs:
4040
${{ runner.os }}-gradle-
4141
- name: Publish Windows Artifacts
4242
if: matrix.os == 'windows-latest'
43+
shell: cmd
4344
run: >
44-
./gradlew release --no-daemon
45-
-Ppublishing.enabled=true
46-
-Ppublishing.github.user=${{ secrets.PUBLISHING_GITHUB_USER }}
47-
-Ppublishing.github.token=${{ secrets.PUBLISHING_GITHUB_TOKEN }}
48-
-Ppublishing.space.user=${{ secrets.PUBLISHING_SPACE_USER }}
49-
-Ppublishing.space.token=${{ secrets.PUBLISHING_SPACE_TOKEN }}
45+
./gradlew release --no-daemon --build-cache -Ppublishing.enabled=true
46+
-Ppublishing.space.user=${{ secrets.SPACE_APP_ID }}
47+
-Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }}
5048
- name: Publish Mac Artifacts
5149
if: matrix.os == 'macOS-latest'
5250
run: >
53-
./gradlew release --no-daemon
54-
-Ppublishing.enabled=true
55-
-Ppublishing.platform=macosX64
56-
-Ppublishing.github.user=${{ secrets.PUBLISHING_GITHUB_USER }}
57-
-Ppublishing.github.token=${{ secrets.PUBLISHING_GITHUB_TOKEN }}
58-
-Ppublishing.space.user=${{ secrets.PUBLISHING_SPACE_USER }}
59-
-Ppublishing.space.token=${{ secrets.PUBLISHING_SPACE_TOKEN }}
51+
./gradlew release --no-daemon --build-cache -Ppublishing.enabled=true -Ppublishing.platform=macosX64
52+
-Ppublishing.space.user=${{ secrets.SPACE_APP_ID }}
53+
-Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }}

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,31 @@
1111

1212
### Fixed
1313

14+
### Security
15+
## [0.5.0]
16+
### Added
17+
- Experimental `listOfSpec` delegate.
18+
19+
### Changed
20+
- **API breaking** Config is deprecated, use `ObservableMeta` instead.
21+
- **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.
22+
- Kotlin 1.5.10
23+
- Build tools 0.10.0
24+
- Relaxed type restriction on `MetaConverter`. Now nullables are available.
25+
- **Huge API-breaking refactoring of Meta**. Meta now can have both value and children. There is only one kind of descriptor now.
26+
- **API breaking** `String.toName()` is replaced by `Name.parse()`
27+
- **API breaking** Configurable`config` changed to `meta`
28+
29+
### Removed
30+
- `Config`
31+
- Public PluginManager mutability
32+
- Tables and tables-exposed moved to the separate project `tables.kt`
33+
- BinaryMetaFormat. Use CBOR encoding instead
34+
35+
### Fixed
36+
- Proper json array index treatment.
37+
- Proper json index for single-value array.
38+
1439
### Security
1540
## [0.4.0]
1641
### Added

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@
3535
> **Maturity**: PROTOTYPE
3636
<hr/>
3737
38-
* ### [dataforge-tables](dataforge-tables)
39-
>
40-
>
41-
> **Maturity**: PROTOTYPE
42-
<hr/>
43-
4438
* ### [dataforge-workspace](dataforge-workspace)
4539
>
4640
>

build.gradle.kts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
allprojects {
66
group = "space.kscience"
7-
version = "0.4.0"
7+
version = "0.5.0"
88
}
99

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

18-
changelog{
19-
version = project.version.toString()
20-
}
21-
2218
ksciencePublish {
2319
github("dataforge-core")
2420
space("https://maven.pkg.jetbrains.space/mipt-npm/p/sci/maven")

dataforge-context/api/dataforge-context.api

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,6 @@ public final class space/kscience/dataforge/context/PluginFactory$Companion {
164164
}
165165

166166
public final class space/kscience/dataforge/context/PluginManager : java/lang/Iterable, kotlin/jvm/internal/markers/KMappedMarker, space/kscience/dataforge/context/ContextAware {
167-
public fun <init> (Lspace/kscience/dataforge/context/Context;)V
168-
public final fun fetch (Lspace/kscience/dataforge/context/PluginFactory;Lspace/kscience/dataforge/meta/Meta;Z)Lspace/kscience/dataforge/context/Plugin;
169-
public final fun fetch (Lspace/kscience/dataforge/context/PluginFactory;ZLkotlin/jvm/functions/Function1;)Lspace/kscience/dataforge/context/Plugin;
170-
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;
171-
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;
172167
public final fun find (ZLkotlin/jvm/functions/Function1;)Lspace/kscience/dataforge/context/Plugin;
173168
public static synthetic fun find$default (Lspace/kscience/dataforge/context/PluginManager;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lspace/kscience/dataforge/context/Plugin;
174169
public final fun get (Lkotlin/reflect/KClass;Lspace/kscience/dataforge/context/PluginTag;Z)Ljava/lang/Object;
@@ -178,7 +173,6 @@ public final class space/kscience/dataforge/context/PluginManager : java/lang/It
178173
public fun getContext ()Lspace/kscience/dataforge/context/Context;
179174
public fun iterator ()Ljava/util/Iterator;
180175
public final fun list (Z)Ljava/util/Collection;
181-
public final fun remove (Lspace/kscience/dataforge/context/Plugin;)V
182176
}
183177

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

231-
public abstract interface annotation class space/kscience/dataforge/descriptors/Attribute : java/lang/annotation/Annotation {
232-
public abstract fun key ()Ljava/lang/String;
233-
public abstract fun value ()Ljava/lang/String;
234-
}
235-
236-
public abstract interface annotation class space/kscience/dataforge/descriptors/Attributes : java/lang/annotation/Annotation {
237-
public abstract fun attrs ()[Lspace/kscience/dataforge/descriptors/Attribute;
238-
}
239-
240-
public abstract interface annotation class space/kscience/dataforge/descriptors/ItemDef : java/lang/annotation/Annotation {
241-
public abstract fun info ()Ljava/lang/String;
242-
public abstract fun multiple ()Z
243-
public abstract fun required ()Z
244-
}
245-
246-
public abstract interface annotation class space/kscience/dataforge/descriptors/ValueDef : java/lang/annotation/Annotation {
247-
public abstract fun allowed ()[Ljava/lang/String;
248-
public abstract fun def ()Ljava/lang/String;
249-
public abstract fun enumeration ()Ljava/lang/Class;
250-
public abstract fun type ()[Lspace/kscience/dataforge/values/ValueType;
251-
}
252-
253225
public final class space/kscience/dataforge/properties/PropertyKt {
254226
}
255227

dataforge-context/src/commonMain/kotlin/space/kscience/dataforge/context/Context.kt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ package space.kscience.dataforge.context
33
import kotlinx.coroutines.CoroutineScope
44
import kotlinx.coroutines.Job
55
import kotlinx.coroutines.SupervisorJob
6-
import space.kscience.dataforge.meta.Laminate
7-
import space.kscience.dataforge.meta.Meta
8-
import space.kscience.dataforge.meta.MetaRepr
9-
import space.kscience.dataforge.meta.itemSequence
6+
import space.kscience.dataforge.meta.*
107
import space.kscience.dataforge.misc.Named
118
import space.kscience.dataforge.names.Name
129
import space.kscience.dataforge.provider.Provider
@@ -26,6 +23,7 @@ import kotlin.jvm.Synchronized
2623
public open class Context internal constructor(
2724
final override val name: Name,
2825
public val parent: Context?,
26+
plugins: Set<Plugin>, // set of unattached plugins
2927
meta: Meta,
3028
) : Named, MetaRepr, Provider, CoroutineScope {
3129

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

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

4947
public fun content(target: String, inherit: Boolean): Map<Name, Any> {
5048
return if (inherit) {
5149
when (target) {
52-
PROPERTY_TARGET -> properties.itemSequence().toMap()
50+
PROPERTY_TARGET -> properties.nodeSequence().toMap()
5351
Plugin.TARGET -> plugins.list(true).associateBy { it.name }
5452
else -> emptyMap()
5553
}
5654
} else {
5755
when (target) {
58-
PROPERTY_TARGET -> properties.layers.firstOrNull()?.itemSequence()?.toMap() ?: emptyMap()
56+
PROPERTY_TARGET -> properties.layers.firstOrNull()?.nodeSequence()?.toMap() ?: emptyMap()
5957
Plugin.TARGET -> plugins.list(false).associateBy { it.name }
6058
else -> emptyMap()
6159
}
@@ -97,8 +95,8 @@ public open class Context internal constructor(
9795

9896
override fun toMeta(): Meta = Meta {
9997
"parent" to parent?.name
100-
"properties" put properties.layers.firstOrNull()
101-
"plugins" put plugins.map { it.toMeta() }
98+
properties.layers.firstOrNull()?.let { set("properties", it) }
99+
"plugins" putIndexed plugins.map { it.toMeta() }
102100
}
103101

104102
public companion object {

0 commit comments

Comments
 (0)