Skip to content

Latest commit

 

History

History
69 lines (42 loc) · 2.04 KB

File metadata and controls

69 lines (42 loc) · 2.04 KB

Cross-language dialect (CLD) is a set of tools and rules to write portable code for select programming languages at once.

Context and Entities keep the state (data), they are described in YML and can be converted to:

  • Kotlin

JavaScript

Run tests in a web browser by opening ./javascript/do-test.html

Swift

Build tests on macOS:

$ ./swift/make

Run tests on macOS:

$ ./swift/do-test

Kotlin

Build tests on macOS:

$ ./kotlin/make

Run tests on macOS:

$ ./kotlin/do-test

Translator

Build translator:

$ cd translator && ./gradlew jar

Parse entities' YML:

$ cd translator && ./run/run-java --file=../test/test-dir/entities.yml --out=../test/test-dir/entities.kt --dbg

Current availability of functions

Generation of entities

Type JavaScript Kotlin Swift
1 struct X X
2 context X X

Generation of entity fields for Kotlin

YML type Kotlin type Default value YML example Kotlin example
1 Bool Boolean false didLaunch: Bool var didLaunch: Boolean = false
2 Double Double 0 angle: Double var angle: Double = 0
3 Int Int 0 selectedItemId: Int var selectedItemId: Int = 0
4 Long Long 0 timestamp: Long var timestamp: Long = 0
5 String String "" method: String var method: String = ""
6 Type Type Type() request: NetRequest var request: NetRequest = NetRequest()
7 [Type] Array<Type> arrayOf() arguments: [String] var arguments: Array<String> = arrayOf()
8 [TypeA: TypeB] Map<TypeA, TypeB> mapOf() templates: [String: String] var templates: Map<String, String> = mapOf()

Utilities

Updating the version in all files:

$ ./util/update-version 1.0.1 1.1.0