Skip to content

Commit

Permalink
Merge pull request #16 from mipt-npm/dev
Browse files Browse the repository at this point in the history
0.2.0
  • Loading branch information
altavir authored Feb 22, 2021
2 parents 3412d96 + b278747 commit f53ab04
Show file tree
Hide file tree
Showing 34 changed files with 3,024 additions and 991 deletions.
9 changes: 9 additions & 0 deletions .space.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* JetBrains Space Automation
* This Kotlin-script file lets you automate build activities
* For more info, see https://www.jetbrains.com/help/space/automation.html
*/

job("Build and run tests") {
gradlew("openjdk:11", "build")
}
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Changelog

## [0.2.0]
### Added
- Equality for gdml nodes
- Material builders
- Preprocessor for Gdml expressions (JVM only)

### Changed
- **Group name changed to `space.kscience`**
- **GDML changed to Gdml to adhere to the code style**
- Kotlin 1.4.30
- Kotlinx-serialization 1.1.0
- XmlUtil 0.81.0

### Deprecated

### Removed

### Fixed

### Security
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# GDML bindings for Kotlin
# Gdml bindings for Kotlin

[![JetBrains Research](https://jb.gg/badges/research.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![DOI](https://zenodo.org/badge/195530015.svg)](https://zenodo.org/badge/latestdoi/195530015)
[ ![Download](https://api.bintray.com/packages/mipt-npm/scientifik/gdml/images/download.svg) ](https://bintray.com/mipt-npm/scientifik/gdml/_latestVersion)

Multiplatform bindings for GDML geometry specification. Utilized kotlinx.serialization
to read and writing GDML configurations.
Multiplatform bindings for Gdml geometry specification. Utilized kotlinx.serialization
to read and writing Gdml configurations.

In future it is possible to add additional module to launch GEANT4 simulations from Kotlin code.

Expand Down Expand Up @@ -41,13 +41,13 @@ Read:
import scientifik.gdml.parse

val gdmlString: String
val gdml = GDML.parse(gdmlString)
val gdml = Gdml.parse(gdmlString)
```

write:
```kotlin
import scientifik.gdml.stringify

val gdml = GDML{}
val gdml = Gdml{}
val gdmlString = gdml.stringify()
```
1,869 changes: 1,869 additions & 0 deletions api/gdml.api

Large diffs are not rendered by default.

57 changes: 21 additions & 36 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,49 +1,34 @@
import scientifik.useSerialization

plugins {
id("scientifik.mpp") version "0.5.2"
id("scientifik.publish") version "0.5.2"
val toolsVersion = "0.8.0"
id("ru.mipt.npm.gradle.project") version toolsVersion
id("ru.mipt.npm.gradle.mpp") version toolsVersion
// id("ru.mipt.npm.native") version toolsVersion
id("ru.mipt.npm.gradle.publish") version toolsVersion
}

group = "scientifik"
version = "0.1.9"
group = "space.kscience"
version = "0.2.0"

useSerialization {
xml()
kscience {
useSerialization{
xml()
}
}

val bintrayRepo by extra("scientifik")
val githubProject by extra("gdml.kt")
repositories {
maven("https://dl.bintray.com/pdvrieze/maven")
}

kotlin {
js {
browser {
testTask {
useKarma {
useChrome()
}
}
}
}
internal val githubProject by extra("gdml.kt")
internal val spaceRepo by extra("https://maven.pkg.jetbrains.space/mipt-npm/p/sci/maven")
internal val bintrayRepo by extra("kscience")

kotlin {
sourceSets {
commonMain{
jvmMain {
dependencies {
api(kotlin("reflect"))
}
}

jvmMain{
dependencies {
api("com.fasterxml.woodstox:woodstox-core:5.0.3")
}
}
}

targets.all {
sourceSets.all {
languageSettings.apply {
useExperimentalAnnotation("kotlinx.serialization.ImplicitReflectionSerializer")
api("com.fasterxml.woodstox:woodstox-core:6.2.3")
implementation("com.github.h0tk3y.betterParse:better-parse:0.4.1")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gdml-source/[email protected]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<!--<gdml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd">-->
<!--<gdml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://service-spi.web.cern.ch/service-spi/app/releases/Gdml/schema/gdml.xsd">-->
<gdml>
<define>
<position name="Coil_1inMagnetpos" x="0" y="-85" z="0" unit="cm"/>
Expand Down
4 changes: 2 additions & 2 deletions gdml-source/babyIAXO.gdml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!ENTITY materials SYSTEM "../../miscellaneous/materials.xml">
]>

<gdml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd">
<gdml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://service-spi.web.cern.ch/service-spi/app/releases/Gdml/schema/gdml.xsd">
<!-- ********************* -->
<!-- ***BEGIN DEFINE*** -->
<!-- GLOBAL -->
Expand Down Expand Up @@ -270,7 +270,7 @@
<!-- ***END DEFINE*** -->
<!-- ********************* -->
<!-- ***BEGIN MATERIALS*** -->
&materials;
<!-- &materials; -->
<!-- ***END MATERIALS*** -->
<!-- ********************* -->
<!-- ***BEGIN SOLIDS*** -->
Expand Down
2 changes: 0 additions & 2 deletions gradle.properties

This file was deleted.

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 3 additions & 2 deletions misc/gdml_comp.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/python
"""
"""
import xml.dom.minidom as md
import sys
import xml.dom.minidom as md


class Vars:
# Dict of variables defined in GDML file
# Dict of variables defined in Gdml file
def __init__(self, defines):
self.var = {}
for v in defines:
Expand Down
18 changes: 2 additions & 16 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
pluginManagement {
repositories {
mavenLocal()
jcenter()
gradlePluginPortal()
maven("https://dl.bintray.com/kotlin/kotlin-eap")
maven("https://dl.bintray.com/mipt-npm/dev")
maven("https://dl.bintray.com/mipt-npm/scientifik")
}

resolutionStrategy {
eachPlugin {
when (requested.id.id) {
"kotlinx-atomicfu" -> useModule("org.jetbrains.kotlinx:atomicfu-gradle-plugin:${requested.version}")
"scientifik.mpp", "scientifik.publish" -> useModule("scientifik:gradle-tools:${requested.version}")
}
}
mavenCentral()
maven("https://repo.kotlin.link")
}
}

enableFeaturePreview("GRADLE_METADATA")

rootProject.name = "gdml"

Loading

0 comments on commit f53ab04

Please sign in to comment.