diff --git a/.appveyor.yml b/.appveyor.yml
deleted file mode 100644
index dc6eeb716..000000000
--- a/.appveyor.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-environment:
- matrix:
- # - JAVA_HOME: C:\Program Files\Java\jdk1.8.0
- - JAVA_HOME: C:\Program Files\Java\jdk11
-
-install:
- - java -version
- - mvn --version
-
-build_script:
- - mvn -B -V -Prun-its clean verify
-
-cache:
- - C:\maven\
- - C:\Users\appveyor\.m2
diff --git a/.github/README.md b/.github/README.md
index 2924aceb7..bbe7d54be 100644
--- a/.github/README.md
+++ b/.github/README.md
@@ -32,7 +32,7 @@ The latest indev build
org.panda-lang
panda
- 0.5.2-alpha
+ 0.5.3-alpha
```
diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
new file mode 100644
index 000000000..e4fb4202d
--- /dev/null
+++ b/.github/workflows/gradle.yml
@@ -0,0 +1,29 @@
+name: "Panda CI"
+
+on:
+ push:
+ branches: [ "next" ]
+ pull_request:
+ branches: [ "next" ]
+
+jobs:
+ gradle:
+ strategy:
+ matrix:
+ os: [ubuntu-latest, macos-latest, windows-latest]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-java@v3
+ with:
+ distribution: temurin
+ java-version: 17
+
+ - name: Make gradlew executable
+ run: chmod +x ./gradlew
+
+ - name: Setup Gradle
+ uses: gradle/gradle-build-action@v2
+
+ - name: Execute Gradle build
+ run: ./gradlew build
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
deleted file mode 100644
index 5744477f1..000000000
--- a/.github/workflows/maven.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-name: Panda CI
-
-on: [push]
-
-jobs:
- build:
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v1
- - name: Set up JDK 1.8
- uses: actions/setup-java@v1
- with:
- java-version: 1.8
- - name: Build with Maven
- run: mvn package --file pom.xml
diff --git a/.gitignore b/.gitignore
index 2532522eb..2f7964c3e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,9 @@ dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
+### Gradle ###
+build/
+!gradle/grails-wrapper.jar
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
diff --git a/LICENSE b/LICENSE
index 301ce4afe..a200afe77 100644
--- a/LICENSE
+++ b/LICENSE
@@ -120,7 +120,7 @@
that such additional attribution notices cannot be construed
as modifying the License.
- You may add Your own copyright statement to Your modifications and
+ You may add Your own copyright declaration to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 000000000..6e5cd7cd1
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,152 @@
+import org.gradle.api.tasks.testing.logging.TestExceptionFormat
+import org.gradle.api.tasks.testing.logging.TestLogEvent
+
+plugins {
+ `java-library`
+ kotlin("jvm") version "1.7.10"
+ `maven-publish`
+ signing
+ id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
+}
+
+description = "Panda | Parent"
+
+allprojects {
+ apply(plugin = "org.jetbrains.kotlin.jvm")
+ apply(plugin = "maven-publish")
+ apply(plugin = "java-library")
+ apply(plugin = "signing")
+
+ repositories {
+ maven("https://maven.reposilite.com/maven-central")
+ }
+
+ group = "org.panda-lang"
+ version = "0.5.3-alpha"
+
+ publishing {
+ repositories {
+ maven {
+ name = "reposilite-repository"
+ url = uri("https://maven.reposilite.com/${if (version.toString().endsWith("-SNAPSHOT")) "snapshots" else "releases"}")
+
+ credentials {
+ username = getEnvOrProperty("MAVEN_NAME", "mavenUser")
+ password = getEnvOrProperty("MAVEN_TOKEN", "mavenPassword")
+ }
+ }
+ }
+ }
+
+ afterEvaluate {
+ description
+ ?.takeIf { it.isNotEmpty() }
+ ?.split("|")
+ ?.let { (projectName, projectDescription) ->
+ publishing {
+ publications {
+ create("library") {
+ pom {
+ name.set(projectName)
+ description.set(projectDescription)
+ url.set("https://github.com/panda-lang/panda")
+
+ licenses {
+ license {
+ name.set("The Apache License, Version 2.0")
+ url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
+ }
+ }
+ developers {
+ developer {
+ id.set("dzikoysk")
+ name.set("dzikoysk")
+ email.set("dzikoysk@dzikoysk.net")
+ }
+ }
+ scm {
+ connection.set("scm:git:git://github.com/panda-lang/panda.git")
+ developerConnection.set("scm:git:ssh://github.com/panda-lang/panda.git")
+ url.set("https://github.com/panda-lang/panda.git")
+ }
+ }
+
+ from(components.getByName("java"))
+ }
+ }
+ }
+
+ if (findProperty("signing.keyId").takeIf { it?.toString()?.trim()?.isNotEmpty() == true } != null) {
+ signing {
+ sign(publishing.publications.getByName("library"))
+ }
+ }
+ }
+ }
+
+ java {
+ withJavadocJar()
+ withSourcesJar()
+ }
+}
+
+subprojects {
+ dependencies {
+ val junit = "5.8.2"
+ testImplementation("org.codehaus.groovy:groovy:3.0.9")
+ testImplementation("org.junit.jupiter:junit-jupiter-api:$junit")
+ testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit")
+ }
+
+ tasks.withType {
+ testLogging {
+ events(
+ TestLogEvent.STARTED,
+ TestLogEvent.PASSED,
+ TestLogEvent.FAILED,
+ TestLogEvent.SKIPPED
+ )
+ exceptionFormat = TestExceptionFormat.FULL
+ showExceptions = true
+ showCauses = true
+ showStackTraces = true
+ showStandardStreams = true
+ }
+
+ maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2)
+ .takeIf { it > 0 }
+ ?: 1
+
+ useJUnitPlatform()
+ }
+
+ tasks.register("release") {
+ dependsOn(
+ "publishAllPublicationsToReposilite-repositoryRepository",
+ "publishToSonatype",
+ )
+ }
+}
+
+
+tasks.register("release") {
+ dependsOn(
+ "clean", "build",
+ "publishAllPublicationsToReposilite-repositoryRepository",
+ "publishAllPublicationsToSonatypeRepository",
+ "closeAndReleaseSonatypeStagingRepository"
+ )
+}
+
+nexusPublishing {
+ repositories {
+ sonatype {
+ nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
+ username.set(getEnvOrProperty("SONATYPE_USER", "sonatypeUser"))
+ password.set(getEnvOrProperty("SONATYPE_PASSWORD", "sonatypePassword"))
+ }
+ }
+}
+
+fun getEnvOrProperty(env: String, property: String): String? =
+ System.getenv(env) ?: findProperty(property)?.toString()
\ No newline at end of file
diff --git a/examples/hello_world.panda b/examples/hello_world.panda
deleted file mode 100644
index 5e92b129d..000000000
--- a/examples/hello_world.panda
+++ /dev/null
@@ -1,5 +0,0 @@
-// every program needs a place to start its execution, that's the main statement
-main {
- // print Hello Panda in the console
- log 'Hello Panda'
-}
\ No newline at end of file
diff --git a/examples/lang/array.panda b/examples/lang/array.panda
deleted file mode 100644
index 31e4eb47e..000000000
--- a/examples/lang/array.panda
+++ /dev/null
@@ -1,10 +0,0 @@
-require 'java' { collections }
-
-import java.util.Arrays
-
-main {
- let array = 'Hello World'.split(' ')
- array.set(1, 'Panda')
- log array.get(0)
- log array.toList().get(1)
-}
\ No newline at end of file
diff --git a/examples/lang/basic_types.panda b/examples/lang/basic_types.panda
deleted file mode 100644
index 0313e664b..000000000
--- a/examples/lang/basic_types.panda
+++ /dev/null
@@ -1,23 +0,0 @@
-main {
- // Numbers
- log 123
- log 123L
- log -123
-
- // Floating-point numbers
- log 1.0
- log .1F
- log 0.1D
- log -0.1337
- log 0xCAFEBABE
- log 0xFFFFFFFFFFFFFF
-
- // Texts
- log 'Michael Scott said "I love inside jokes. I hope to be a part of one someday."'
- log "That's what she said"
- log `"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe."`
-
- // Logic
- log true
- log false
-}
\ No newline at end of file
diff --git a/examples/lang/bitwise.panda b/examples/lang/bitwise.panda
deleted file mode 100644
index c761f4887..000000000
--- a/examples/lang/bitwise.panda
+++ /dev/null
@@ -1,8 +0,0 @@
-main {
- log -8 == ~7
- log 1 == (5 & 3)
- log 7 == (5 | 3)
- log 6 == (5 ^ 3)
- log 4 == (2 << 1)
- log 2 == (4 >> 1)
-}
\ No newline at end of file
diff --git a/examples/lang/branching.panda b/examples/lang/branching.panda
deleted file mode 100644
index 66e0bb288..000000000
--- a/examples/lang/branching.panda
+++ /dev/null
@@ -1,39 +0,0 @@
-main {
- Branching.'return'()
- log '#onlypanda' == Branching.'return with result'()
-
- Branching.'break'()
- log 5, Branching.'continue'()
-}
-
-type Branching {
-
- open static 'return' () {
- while true {
- return
- }
- }
-
- open static 'return with result' () -> String {
- return '#onlypanda'
- }
-
- open static 'break' () {
- while true {
- return
- }
- }
-
- open static 'continue' () -> Int {
- mut Int value = 0
-
- while true {
- if ++value != 5 {
- continue
- }
-
- return value
- }
- }
-
-}
\ No newline at end of file
diff --git a/examples/lang/comments.panda b/examples/lang/comments.panda
deleted file mode 100644
index da495b224..000000000
--- a/examples/lang/comments.panda
+++ /dev/null
@@ -1,13 +0,0 @@
-main {
- // single line comment
-
- /*
- Multiline
- Comment
- */
-
- /**
- * Documentation comment
- * It's used to generate documentation of your program in a standardized way
- */
-}
\ No newline at end of file
diff --git a/examples/lang/constructor.panda b/examples/lang/constructor.panda
deleted file mode 100644
index de1579cba..000000000
--- a/examples/lang/constructor.panda
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * PROPOSALS: Primary constructor
- * ~ https://github.com/panda-lang/panda/issues/612
- */
-
-/* v1 */
-open type Foo {
-
- shared String name
- shared Int value
- internal nil Bar optional
-
- init (String name, Int value) {
- this.name = name
- this.value = value
- }
-
- init (String name, Int value, Bar optional) {
- this(name, value)
- this.optional = optional
- }
-
-}
-
-/* v2 */
-open type Foo (
-
- shared String name
- shared Int value
-
-) {
-
- internal nil Bar optional
-
- init (String name, Int value, Bar optional) {
- this(name, value)
- this.optional = optional
- }
-
-}
-
-/* v3 */
-open type Foo {
-
- shared String name
- shared Int value
-
- ~ internal State state1
- ~ internal mut State mutableState2 = State()
-
- init (base) {
- this.mutableState1 = State(name, value)
- }
-
-}
-
-/* v4 */
-open type Foo {
-
- shared base String name
- shared base Int value
-
- internal State state1
- internal mut State mutableState2 = State()
-
- init (base) {
- this.mutableState1 = State(name, value)
- }
-
-}
-
-/* v5 */
-open type Foo {
-
- shared String name
- shared Int value
-
- internal ext State state1
- internal mut ext State mutableState2 = State()
-
- init (base) {
- this.mutableState1 = State(name, value)
- }
-
-}
\ No newline at end of file
diff --git a/examples/lang/crease.panda b/examples/lang/crease.panda
deleted file mode 100644
index b6e97adea..000000000
--- a/examples/lang/crease.panda
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Increase and decrease operations on different number types
- */
-main {
- /* Byte */
-
- mut Byte byte = 1B
-
- log 2 == ++byte
- log 2 == byte++
- log 2 == --byte
- log 2 == byte--
-
- log 1 == byte
-
- /* Short */
-
- mut Short short = 1S
-
- log 2 == ++short
- log 2 == short++
- log 2 == --short
- log 2 == short--
-
- log 1 == short
-
- /* Int */
-
- mut Int int = 1
-
- log 2 == ++int
- log 2 == int++
- log 2 == --int
- log 2 == int--
-
- log 1 == int
-
- /* Long */
-
- mut Long long = 1L
-
- log 2 == ++long
- log 2 == long++
- log 2 == --long
- log 2 == long--
-
- log 1 == long
-
- /* Float */
-
- mut Float float = 1.0F
-
- log 2 == ++float
- log 2 == float++
- log 2 == --float
- log 2 == float--
-
- log 1 == float
-
- /* Double */
-
- mut Double double = 1.0D
-
- log 2 == ++double
- log 2 == double++
- log 2 == --double
- log 2 == double--
-
- log 1 == double
-}
\ No newline at end of file
diff --git a/examples/lang/for.panda b/examples/lang/for.panda
deleted file mode 100644
index 148b91182..000000000
--- a/examples/lang/for.panda
+++ /dev/null
@@ -1,11 +0,0 @@
-main {
- /* Standard indexed for loop */
-
- mut Int indexedLoop = 0
-
- for (mut Int index = 0; index < 2; index++) {
- indexedLoop++
- }
-
- log 2 == indexedLoop
-}
\ No newline at end of file
diff --git a/examples/lang/foreach.panda b/examples/lang/foreach.panda
deleted file mode 100644
index e67e8c739..000000000
--- a/examples/lang/foreach.panda
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'java' { base, collections }
-
-main {
- /* Iterator based for-each loop */
-
- List iterable = new ArrayList()
- iterable.add('#bokkitty')
- iterable.add('#onlypanda')
-
- foreach (String value : iterable) {
- log value
- }
-}
\ No newline at end of file
diff --git a/examples/lang/generics.panda b/examples/lang/generics.panda
deleted file mode 100644
index 4878b664e..000000000
--- a/examples/lang/generics.panda
+++ /dev/null
@@ -1,41 +0,0 @@
-main {
- /* Parametrized instance */
- Foo parametrizedType = new Foo('test')
-
- /* Parametrized return type */
- String parametrizedValue = parametrizedType.getValue()
- // Int invalidValue = genericType.getValue() /* Should not compile */
-
- /* Parametrized arguments */
- parametrizedType.setValue(parametrizedValue)
- // genericType.setValue(10) /* Should not compile */
-
- /* Parametrized re-assignation */
- Foo sameParametrizedType = parametrizedType
- Foo