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

View File

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

View File

@ -5,13 +5,13 @@ plugins {
id 'com.github.johnrengelman.shadow' version '7.1.0' id 'com.github.johnrengelman.shadow' version '7.1.0'
} }
targetCompatibility = 11 java {
sourceCompatibility = 11 toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
}
repositories { repositories {
mavenLocal()
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" } 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 { sourceSets {
main { main {
java { java {
@ -87,11 +71,6 @@ application {
applicationName = 'p8compile' applicationName = 'p8compile'
} }
artifacts {
archives shadowJar
}
shadowJar { shadowJar {
archiveBaseName = 'prog8compiler' archiveBaseName = 'prog8compiler'
archiveVersion = prog8version archiveVersion = prog8version
@ -111,3 +90,5 @@ test {
events "skipped", "failed" events "skipped", "failed"
} }
} }
build.finalizedBy installDist, installShadowDist

View File

@ -3,14 +3,13 @@ plugins {
id "org.jetbrains.kotlin.jvm" id "org.jetbrains.kotlin.jvm"
} }
targetCompatibility = 11
sourceCompatibility = 11
repositories { java {
mavenCentral() toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
} }
dependencies { dependencies {
implementation 'org.antlr:antlr4-runtime:4.9.2' implementation 'org.antlr:antlr4-runtime:4.9.2'
implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.12" 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' 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 { sourceSets {
main { main {
java { java {

View File

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

View File

@ -6,12 +6,13 @@ plugins {
id 'com.github.johnrengelman.shadow' version '7.1.0' id 'com.github.johnrengelman.shadow' version '7.1.0'
} }
targetCompatibility = 11 java {
sourceCompatibility = 11 toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
}
repositories { repositories {
mavenLocal()
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" } maven { url "https://kotlin.bintray.com/kotlinx" }
} }
@ -33,20 +34,6 @@ configurations.all {
exclude group: "org.antlr", module: "antlr4" exclude group: "org.antlr", module: "antlr4"
} }
compileKotlin {
kotlinOptions {
jvmTarget = "11"
// verbose = true
// freeCompilerArgs += "-XXLanguage:+NewInference"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
sourceSets { sourceSets {
main { main {
java { java {
@ -70,11 +57,6 @@ application {
applicationName = 'prog8compilerservicedbus' applicationName = 'prog8compilerservicedbus'
} }
artifacts {
archives shadowJar
}
shadowJar { shadowJar {
archiveBaseName = 'prog8compilerservicedbus' archiveBaseName = 'prog8compilerservicedbus'
archiveVersion = '1.0' archiveVersion = '1.0'
@ -94,3 +76,5 @@ test {
events "skipped", "failed" 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 Gradle build system is used to build the compiler.
The most interesting gradle commands to run are probably: 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. Builds the compiler code and runs all available checks and unit-tests.
Also automatically runs the installDist and installShadowDist tasks.
``./gradlew installDist`` ``./gradlew installDist``
Builds the compiler and installs it with scripts to run it, in the directory Builds the compiler and installs it with scripts to run it, in the directory
``./compiler/build/install/p8compile`` ``./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. Creates a zipfile with the above in it, for easy distribution.
This file can be found in ``./compiler/build/distributions/`` This file can be found in ``./compiler/build/distributions/``
For normal use, the ``installDist`` target should suffice and ater succesful completion For normal use, the ``installDist`` target should suffice and after succesful completion, you can start the compiler with:
of that build task, you can start the compiler with:
``./compiler/build/install/p8compile/bin/p8compile <options> <sourcefile>`` ``./compiler/build/install/p8compile/bin/p8compile <options> <sourcefile>``
@ -44,7 +44,7 @@ of that build task, you can start the compiler with:
.. hint:: .. hint::
Development and testing is done on Linux using the IntelliJ IDEA IDE, 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 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! operating system, please let me know!

View File

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

View File

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