Skip to content

Commit

Permalink
Build Refactor / Devops
Browse files Browse the repository at this point in the history
This changeset refactors the Elide library build to use convention
plugins, written in Kotlin, and completes a number of other cleanups
and refactors. See below for details.

Changes enclosed:
- Begin to adopt shared Micronaut version catalog
- Write convention plugins for common module profiles
- Adopt convention plugins, cleanup module build scripts
- Centralize as much common plugin config as possible
- Opt-in to context receivers support
- Dependency upgrades (see relevant section)
- Rebuild docs and reports
- Version bump -> `1.0-v3-alpha1-rc32`

Changes pending:
- Add module for `bom` / version catalog sharing for Elide
- Add new `ssg` module for generating static content

Dependency upgrades:
- GraalVM SDK: `22.3.0`
- Protobuf: `3.21.2`
- gRPC: `1.50.2`
- GAX: `2.19.5`
- Netty: `4.1.85.Final`
- TCNative: `2.0.54.Final`
- Micronaut Plugin: `3.6.4`
- AtomicFU: `0.18.5`
- Kotlin UUID: `0.6.0`
  • Loading branch information
sgammon committed Nov 13, 2022
1 parent eb98b0f commit 892b7d4
Show file tree
Hide file tree
Showing 3,442 changed files with 101,059 additions and 52,141 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
72 changes: 51 additions & 21 deletions .github/workflows/build.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,32 @@ jobs:
shell: bash

steps:
## Setup: Checkout Code
- name: 'Setup: Checkout'
uses: actions/checkout@v3

## Setup: GraalVM
- uses: graalvm/setup-graalvm@v1
- name: 'Setup: GraalVM'
uses: graalvm/setup-graalvm@v1
with:
components: 'native-image'
components: 'native-image,js'
version: ${{ matrix.gvm }}
java-version: ${{ matrix.java }}
github-token: ${{ secrets.GITHUB_TOKEN }}

## Setup: Checkout Code
- uses: actions/checkout@v3
## Setup: Node
- name: 'Setup: Node'
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

## Setup: Run Yarn
- name: 'Setup: Yarn'
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

## CI: Build
- name: "🛠️ Build"
Expand All @@ -89,7 +105,7 @@ jobs:
with:
cache-read-only: ${{ matrix.os != 'ubuntu-latest' }}
arguments: |
assemble
build
--scan
--dependency-verification=lenient
-Pelide.ci=true
Expand All @@ -109,7 +125,7 @@ jobs:
## Job: Testsuite (JVM)
##
tests-jvm:
runs-on: buildjet-4vcpu-ubuntu-2004
runs-on: ubuntu-latest
continue-on-error: true
permissions:
contents: 'read'
Expand All @@ -123,11 +139,22 @@ jobs:
## Setup: GraalVM
- uses: graalvm/setup-graalvm@v1
with:
components: 'native-image'
components: 'native-image,js'
version: latest
java-version: 17
github-token: ${{ secrets.GITHUB_TOKEN }}

## Setup: Node
- name: 'Setup: Node'
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'

## Setup: Run Yarn
- name: 'Setup: Yarn'
run: yarn

## Run JVM Tests
- name: "Run Tests (JVM)"
uses: gradle/gradle-build-action@v2
Expand Down Expand Up @@ -181,6 +208,7 @@ jobs:
## Run Sonar
- name: "Run Sonar"
uses: gradle/gradle-build-action@v2
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down Expand Up @@ -219,16 +247,24 @@ jobs:
## Setup: GraalVM
- uses: graalvm/setup-graalvm@v1
with:
components: 'native-image'
components: 'native-image,js'
version: latest
java-version: 17
github-token: ${{ secrets.GITHUB_TOKEN }}

## Setup: `gu` components
- name: Install native-image component
run: |
gu install native-image espresso
gu rebuild-images
## Setup: Node
- name: 'Setup: Node'
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

## Setup: Run Yarn
- name: 'Setup: Yarn'
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

## Run Native Tests
- name: "Run Tests (Native)"
Expand Down Expand Up @@ -276,7 +312,7 @@ jobs:
## Setup: GraalVM
- uses: graalvm/setup-graalvm@v1
with:
components: 'native-image'
components: 'native-image,js'
version: latest
java-version: 17
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -416,7 +452,7 @@ jobs:
## Setup: GraalVM
- uses: graalvm/setup-graalvm@v1
with:
components: 'native-image'
components: 'native-image,js'
version: latest
java-version: 17
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -434,12 +470,6 @@ jobs:
## Setup: Checkout Code
- uses: actions/checkout@v3

## Setup: `gu` components
- name: Install native-image component
run: |
gu install native-image espresso
gu rebuild-images
## Setup: GCloud Auth
- id: 'auth'
name: 'Authorize Service Account'
Expand Down
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0-v3-alpha1-rc31
1.0-v3-alpha1-rc32
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `elide` (v3)
# Elide (v3)

_elide: verb. to omit (a sound or syllable) when speaking. to join together; to merge._

Expand All @@ -12,17 +12,17 @@ _elide: verb. to omit (a sound or syllable) when speaking. to join together; to
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.jparrowsec.cn%2Felide-dev%2Fv3.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.jparrowsec.cn%2Felide-dev%2Fv3?ref=badge_shield)


[![Kotlin](https://img.shields.io/badge/Kotlin-1.7.10-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/Kotlin-1.7.21-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/Java-17-blue.svg?logo=java)](https://openjdk.org/projects/jdk/17/)
[![ECMA](https://img.shields.io/badge/ECMA-2020-blue.svg?logo=javascript)](https://reactjs.org/)
[![GraalVM](https://img.shields.io/badge/GraalVM-22.1.x-blue.svg?logo=oracle)](https://www.graalvm.org/)
[![Micronaut](https://img.shields.io/badge/Micronaut-3.5.x-blue.svg?logo=java)](https://micronaut.io)
[![GraalVM](https://img.shields.io/badge/GraalVM-22.3.x-blue.svg?logo=oracle)](https://www.graalvm.org/)
[![Micronaut](https://img.shields.io/badge/Micronaut-3.7.x-blue.svg?logo=java)](https://micronaut.io)
[![React](https://img.shields.io/badge/React-18.x-blue.svg?logo=react)](https://reactjs.org/)


_**Elide is under construction. You can also browse to [`v2`][12] or [`v1`][11].**_

Latest version: `1.0-v3-alpha1-rc31`
Latest version: `1.0-v3-alpha1-rc32`

<hr />

Expand Down Expand Up @@ -274,9 +274,9 @@ not need some of these components:

| Status | **Java** | **Kotlin** | **GraalVM** | **Micronaut** | **React** | **Protobuf/gRPC** |
|-----------------------------------------------------------------|-----------|------------|-------------|---------------|-----------|-------------------|
| ![Status](https://img.shields.io/badge/-experimental-important) | `Java 19` | `1.7.21` | `22.1.x` | `3.6.x` | `18.x` | `3.20.1`/`1.46.0` |
| ![Status](https://img.shields.io/badge/-tested-success) | `Java 17` | `1.7.21` | `22.1.x` | `3.6.x` | `18.x` | `3.20.1`/`1.46.0` |
| ![Status](https://img.shields.io/badge/-tested-success) | `Java 11` | `1.7.21` | `22.1.x` | `3.5.x` | `18.x` | `3.20.1`/`1.46.0` |
| ![Status](https://img.shields.io/badge/-experimental-important) | `Java 19` | `1.7.21` | `22.3.x` | `3.7.x` | `18.x` | `3.20.1`/`1.46.0` |
| ![Status](https://img.shields.io/badge/-tested-success) | `Java 17` | `1.7.21` | `22.3.x` | `3.7.x` | `18.x` | `3.20.1`/`1.46.0` |
| ![Status](https://img.shields.io/badge/-tested-success) | `Java 11` | `1.7.21` | `22.3.x` | `3.5.x` | `18.x` | `3.20.1`/`1.46.0` |
| ![Status](https://img.shields.io/badge/-no%20support-yellow) | `Java 8` | -- | -- | -- | -- | -- |


Expand Down
53 changes: 17 additions & 36 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
@file:Suppress(
"UnstableApiUsage",
"unused",
"UNUSED_VARIABLE",
"DSL_SCOPE_VIOLATION",
)

import java.util.Properties

plugins {
kotlin("plugin.allopen") version libs.versions.kotlin.sdk.get() apply false
kotlin("plugin.serialization") version libs.versions.kotlin.sdk.get() apply false
id("project-report")
alias(libs.plugins.dokka)
alias(libs.plugins.detekt)
id("org.jetbrains.dokka")
id("org.sonarqube")
id("org.jetbrains.kotlinx.kover")
id("io.gitlab.arturbosch.detekt")
alias(libs.plugins.qodana)
alias(libs.plugins.ktlint)
alias(libs.plugins.sonar)
alias(libs.plugins.versionCheck)
alias(libs.plugins.doctor)
jacoco
signing
Expand Down Expand Up @@ -47,13 +44,10 @@ val kotlinLanguageVersion = project.properties["versions.kotlin.language"] as St
val ecmaVersion = project.properties["versions.ecma.language"] as String

tasks.dokkaHtmlMultiModule.configure {
includes.from("README.md")
outputDirectory.set(buildDir.resolve("docs/kotlin/html"))
}

tasks.dokkaGfmMultiModule.configure {
outputDirectory.set(buildDir.resolve("docs/kotlin/gfm"))
}

tasks.create("docs") {
dependsOn(listOf(
"dokkaHtmlMultiModule",
Expand Down Expand Up @@ -105,13 +99,25 @@ sonarqube {
}
}

val dokkaVersion = libs.versions.dokka.get()
val mermaidDokka = "0.4.1"

subprojects {
val name = this.name

apply {
plugin("io.gitlab.arturbosch.detekt")
plugin("org.jlleitschuh.gradle.ktlint")
plugin("org.sonarqube")
plugin("org.jetbrains.dokka")
}

val dokkaPlugin by configurations
dependencies {
dokkaPlugin("org.jetbrains.dokka:versioning-plugin:$dokkaVersion")
dokkaPlugin("org.jetbrains.dokka:templating-plugin:$dokkaVersion")
dokkaPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:$dokkaVersion")
dokkaPlugin("com.glureau:html-mermaid-dokka-plugin:$mermaidDokka")
}

sonarqube {
Expand Down Expand Up @@ -177,31 +183,6 @@ allprojects {
mavenCentral()
google()
}
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = javaLanguageVersion
targetCompatibility = javaLanguageVersion
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompileCommon>().configureEach {
kotlinOptions {
apiVersion = kotlinLanguageVersion
languageVersion = kotlinLanguageVersion
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
apiVersion = kotlinLanguageVersion
languageVersion = kotlinLanguageVersion
jvmTarget = javaLanguageVersion
javaParameters = true
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile>().configureEach {
kotlinOptions {
apiVersion = kotlinLanguageVersion
languageVersion = kotlinLanguageVersion
target = ecmaVersion
}
}
}

tasks.register("resolveAndLockAll") {
Expand Down
17 changes: 17 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
@file:Suppress(
"DSL_SCOPE_VIOLATION",
)

val kotlinVersion = "1.7.21"

plugins {
`kotlin-dsl`
`kotlin-dsl-precompiled-script-plugins`
}

repositories {
Expand All @@ -13,5 +18,17 @@ repositories {

dependencies {
api(kotlin("gradle-plugin"))
implementation(libs.plugin.detekt)
implementation(libs.plugin.dokka)
implementation(libs.plugin.kover)
implementation(libs.plugin.sonar)
implementation(libs.plugin.spotless)
implementation(libs.plugin.testLogger)
implementation(libs.plugin.versionCheck)
implementation(libs.plugin.kotlin.allopen)
implementation(libs.plugin.kotlin.noarg)
implementation(libs.plugin.kotlinx.atomicfu)
implementation(libs.plugin.kotlinx.serialization)
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
}
8 changes: 8 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../gradle/elide.versions.toml"))
}
}
}
57 changes: 57 additions & 0 deletions buildSrc/src/main/kotlin/Elide.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

/** Static library configuration values. */
object Elide {
/** Name of the library. */
const val name = "elide"

/** Major release version for Elide. */
const val track = "v3"

/** Major library version. */
const val majorVersion = "1.0"

/** Major library version tag. */
const val versionTag = "alpha1"

/** Revision value for the library. */
const val revision = 32

/** Version string for the library. */
const val version = "$majorVersion-$track-$versionTag-rc$revision"

/** Latest plugin version. */
const val pluginVersion = "1.0.0-beta9"

/** Maven group shared by Elide artifacts. */
const val group = "dev.elide"

/** Compiler args to include in all Kotlin targets. */
val compilerArgs = listOf(
"-Xcontext-receivers",
)

/** Compiler args to include in Kotlin JVM targets. */
val jvmCompilerArgs = compilerArgs.plus(listOf(
"-Xuse-k2",
))

/** Compiler args to include in Kotlin JS targets. */
val jsCompilerArgs = compilerArgs

/** Compiler args to include in Kotlin MPP targets. */
val mppCompilerArgs = compilerArgs

/** Compiler args to include in Kotlin JVM targets which use `kapt`. */
val kaptCompilerArgs = compilerArgs.plus(listOf(
"-Xallow-unstable-dependencies",
))

/** Minimum JVM version. */
const val jvmTarget = "11"

/** Kotlin SDK and platform version. */
const val kotlinSdk = "1.7.21"

/** Kotlin language version. */
const val kotlinLanguage = "1.7"
}
Loading

0 comments on commit 892b7d4

Please sign in to comment.