simplified gradle config, automatically run installDist task after build

This commit is contained in:
Irmen de Jong 2021-10-30 12:01:52 +02:00
parent 7b69df4db2
commit 97836e18b2
11 changed files with 55 additions and 167 deletions

View File

@ -1,3 +1,10 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.5.30" apply false
id "org.jetbrains.kotlin.jvm" version "$kotlinVersion" apply false
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
}
}

View File

@ -5,13 +5,10 @@ plugins {
id "org.jetbrains.kotlin.jvm"
}
targetCompatibility = 11
sourceCompatibility = 11
repositories {
mavenLocal()
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
}
dependencies {
@ -28,20 +25,6 @@ dependencies {
}
compileKotlin {
kotlinOptions {
jvmTarget = "11"
// verbose = true
// freeCompilerArgs += "-XXLanguage:+NewInference"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
sourceSets {
main {
java {

View File

@ -5,13 +5,10 @@ plugins {
id "org.jetbrains.kotlin.jvm"
}
targetCompatibility = 11
sourceCompatibility = 11
repositories {
mavenLocal()
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
}
dependencies {
@ -27,20 +24,6 @@ dependencies {
}
compileKotlin {
kotlinOptions {
jvmTarget = "11"
// verbose = true
// freeCompilerArgs += "-XXLanguage:+NewInference"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
sourceSets {
main {
java {

View File

@ -5,13 +5,13 @@ plugins {
id 'com.github.johnrengelman.shadow' version '7.1.0'
}
targetCompatibility = 11
sourceCompatibility = 11
java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
}
@ -47,22 +47,6 @@ configurations {
}
compileKotlin {
kotlinOptions {
jvmTarget = "11"
useIR = true
// verbose = true
// freeCompilerArgs += "-XXLanguage:+NewInference"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
useIR = true
}
}
sourceSets {
main {
java {
@ -87,11 +71,6 @@ application {
applicationName = 'p8compile'
}
artifacts {
archives shadowJar
}
shadowJar {
archiveBaseName = 'prog8compiler'
archiveVersion = prog8version
@ -111,3 +90,5 @@ test {
events "skipped", "failed"
}
}
build.finalizedBy installDist, installShadowDist

View File

@ -3,14 +3,13 @@ plugins {
id "org.jetbrains.kotlin.jvm"
}
targetCompatibility = 11
sourceCompatibility = 11
repositories {
mavenCentral()
java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
}
dependencies {
implementation 'org.antlr:antlr4-runtime:4.9.2'
implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.12"
@ -26,22 +25,6 @@ configurations.all {
exclude group: 'com.ibm.icu', module: 'icu4j'
}
compileKotlin {
kotlinOptions {
jvmTarget = "11"
useIR = true
// verbose = true
// freeCompilerArgs += "-XXLanguage:+NewInference"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
useIR = true
}
}
sourceSets {
main {
java {

View File

@ -5,13 +5,10 @@ plugins {
id "org.jetbrains.kotlin.jvm"
}
targetCompatibility = 11
sourceCompatibility = 11
repositories {
mavenLocal()
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
}
dependencies {
@ -26,20 +23,6 @@ dependencies {
}
compileKotlin {
kotlinOptions {
jvmTarget = "11"
// verbose = true
// freeCompilerArgs += "-XXLanguage:+NewInference"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
sourceSets {
main {
java {

View File

@ -6,12 +6,13 @@ plugins {
id 'com.github.johnrengelman.shadow' version '7.1.0'
}
targetCompatibility = 11
sourceCompatibility = 11
java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
}
@ -33,20 +34,6 @@ configurations.all {
exclude group: "org.antlr", module: "antlr4"
}
compileKotlin {
kotlinOptions {
jvmTarget = "11"
// verbose = true
// freeCompilerArgs += "-XXLanguage:+NewInference"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
sourceSets {
main {
java {
@ -70,11 +57,6 @@ application {
applicationName = 'prog8compilerservicedbus'
}
artifacts {
archives shadowJar
}
shadowJar {
archiveBaseName = 'prog8compilerservicedbus'
archiveVersion = '1.0'
@ -94,3 +76,5 @@ test {
events "skipped", "failed"
}
}
build.finalizedBy installDist, installShadowDist

View File

@ -21,8 +21,9 @@ Then you can choose a few ways to get a compiler:
The Gradle build system is used to build the compiler.
The most interesting gradle commands to run are probably:
``./gradlew check``
``./gradlew build``
Builds the compiler code and runs all available checks and unit-tests.
Also automatically runs the installDist and installShadowDist tasks.
``./gradlew installDist``
Builds the compiler and installs it with scripts to run it, in the directory
``./compiler/build/install/p8compile``
@ -34,8 +35,7 @@ The most interesting gradle commands to run are probably:
Creates a zipfile with the above in it, for easy distribution.
This file can be found in ``./compiler/build/distributions/``
For normal use, the ``installDist`` target should suffice and ater succesful completion
of that build task, you can start the compiler with:
For normal use, the ``installDist`` target should suffice and after succesful completion, you can start the compiler with:
``./compiler/build/install/p8compile/bin/p8compile <options> <sourcefile>``
@ -44,7 +44,7 @@ of that build task, you can start the compiler with:
.. hint::
Development and testing is done on Linux using the IntelliJ IDEA IDE,
but the compiler should run on most operating systems that provide a fairly modern
java runtime. If you do have trouble building or running the compiler on your
java runtime (11 or newer). If you do have trouble building or running the compiler on your
operating system, please let me know!

View File

@ -3,3 +3,5 @@ org.gradle.console=rich
org.gradle.parallel=true
org.gradle.daemon=true
kotlin.code.style=official
javaVersion=11
kotlinVersion=1.5.30

View File

@ -6,12 +6,13 @@ plugins {
id 'com.github.johnrengelman.shadow' version '7.1.0'
}
targetCompatibility = 11
sourceCompatibility = 11
java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
}
@ -37,21 +38,6 @@ configurations.all {
exclude group: "org.antlr", module: "antlr4"
}
compileKotlin {
kotlinOptions {
jvmTarget = "11"
// verbose = true
// freeCompilerArgs += "-XXLanguage:+NewInference"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
sourceSets {
main {
java {
@ -75,11 +61,6 @@ application {
applicationName = 'prog8compilerservicehttp'
}
artifacts {
archives shadowJar
}
shadowJar {
archiveBaseName = 'prog8compilerservicehttp'
archiveVersion = '1.0'
@ -99,3 +80,5 @@ test {
events "skipped", "failed"
}
}
build.finalizedBy installDist, installShadowDist

View File

@ -3,11 +3,10 @@ plugins {
id 'java'
}
targetCompatibility = 11
sourceCompatibility = 11
repositories {
mavenCentral()
java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
}
dependencies {