From 68e1815e79d11ae5a7a53ed375c9c8e18a826eae Mon Sep 17 00:00:00 2001 From: Martin Bonnin Date: Fri, 12 Jul 2024 19:07:09 +0200 Subject: [PATCH 1/2] update to librarian 0.0.4 --- build-logic/build.gradle.kts | 14 -------------- build-logic/settings.gradle.kts | 15 --------------- build.gradle.kts | 16 +++++++--------- gradle/libs.versions.toml | 7 +++++++ librarian.properties | 4 +--- normalized-cache-incubating/build.gradle.kts | 4 ++-- .../build.gradle.kts | 4 ++-- settings.gradle.kts | 2 -- 8 files changed, 19 insertions(+), 47 deletions(-) delete mode 100644 build-logic/build.gradle.kts delete mode 100644 build-logic/settings.gradle.kts diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts deleted file mode 100644 index a3b018dd..00000000 --- a/build-logic/build.gradle.kts +++ /dev/null @@ -1,14 +0,0 @@ -plugins { - `embedded-kotlin` -} - -dependencies { - implementation(libs.kgp) - implementation(libs.librarian) - implementation(libs.atomicfu.plugin) - implementation(libs.android.plugin) - implementation(libs.sqldelight.plugin) - implementation(libs.apollo.gradle.plugin) -} - -group = "build-logic" diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts deleted file mode 100644 index badc03fd..00000000 --- a/build-logic/settings.gradle.kts +++ /dev/null @@ -1,15 +0,0 @@ -pluginManagement { - listOf(repositories, dependencyResolutionManagement.repositories).forEach { - it.mavenCentral() - it.gradlePluginPortal() - it.google() - } -} - -dependencyResolutionManagement { - versionCatalogs { - create("libs") { - from(files("../gradle/libs.versions.toml")) - } - } -} diff --git a/build.gradle.kts b/build.gradle.kts index 0e44ee01..6e1f45fa 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,13 +1,11 @@ -import com.gradleup.librarian.core.librarianRoot +import com.gradleup.librarian.gradle.librarianRoot -buildscript { - repositories { - mavenCentral() - google() - } - dependencies { - classpath("build-logic:build-logic") - } +plugins { + alias(libs.plugins.kotlin).apply(false) + alias(libs.plugins.android).apply(false) + alias(libs.plugins.librarian).apply(false) + alias(libs.plugins.atomicfu).apply(false) + alias(libs.plugins.sqldelight).apply(false) } librarianRoot() diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 53c392a8..d93205ae 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -38,3 +38,10 @@ slf4j-nop = "org.slf4j:slf4j-nop:2.0.13" androidx-sqlite = { group = "androidx.sqlite", name = "sqlite", version.ref = "androidx-sqlite" } androidx-sqlite-framework = { group = "androidx.sqlite", name = "sqlite-framework", version.ref = "androidx-sqlite" } androidx-startup-runtime = "androidx.startup:startup-runtime:1.1.1" + +[plugins] +kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin-plugin" } +android = { id = "com.android.library", version.ref = "android-plugin" } +librarian = { id = "com.gradleup.librarian", version = "0.0.4" } +atomicfu = { id = "org.jetbrains.kotlin.plugin.atomicfu", version.ref = "kotlin-plugin" } +sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" } \ No newline at end of file diff --git a/librarian.properties b/librarian.properties index f4e55947..24d09bbe 100644 --- a/librarian.properties +++ b/librarian.properties @@ -4,9 +4,7 @@ kotlin.compatibility=2.0.0 kdoc.olderVersions= kdoc.artifactId=kdoc -sonatype.host=S01 - -git.snapshots=main +sonatype.backend=S01 pom.groupId=com.apollographql.cache pom.version=0.0.3-SNAPSHOT diff --git a/normalized-cache-incubating/build.gradle.kts b/normalized-cache-incubating/build.gradle.kts index 067bd774..9c88fa9a 100644 --- a/normalized-cache-incubating/build.gradle.kts +++ b/normalized-cache-incubating/build.gradle.kts @@ -1,4 +1,4 @@ -import com.gradleup.librarian.core.librarianModule +import com.gradleup.librarian.gradle.librarianModule import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl @@ -7,7 +7,7 @@ plugins { id("kotlinx-atomicfu") } -librarianModule() +librarianModule(true) kotlin { jvm() diff --git a/normalized-cache-sqlite-incubating/build.gradle.kts b/normalized-cache-sqlite-incubating/build.gradle.kts index cf984dd8..cbc3da6d 100644 --- a/normalized-cache-sqlite-incubating/build.gradle.kts +++ b/normalized-cache-sqlite-incubating/build.gradle.kts @@ -1,4 +1,4 @@ -import com.gradleup.librarian.core.librarianModule +import com.gradleup.librarian.gradle.librarianModule import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi plugins { @@ -7,7 +7,7 @@ plugins { id("app.cash.sqldelight") } -librarianModule() +librarianModule(true) kotlin { jvm() diff --git a/settings.gradle.kts b/settings.gradle.kts index 04a1e1ea..d13d8bb5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,6 +5,4 @@ pluginManagement { } } -includeBuild("build-logic") - include("normalized-cache-incubating", "normalized-cache-sqlite-incubating") From 1c7fd39e88d6e5c8091e0997f8653076cff4556f Mon Sep 17 00:00:00 2001 From: Martin Bonnin Date: Fri, 12 Jul 2024 19:09:08 +0200 Subject: [PATCH 2/2] Synchronize documentation --- ...l-request.yaml => build-pull-request.yaml} | 7 +- .../{publish-doc.yaml => publish-docs.yaml} | 24 +++++-- .github/workflows/publish-release.yaml | 12 ++-- .github/workflows/publish-snapshot.yaml | 12 ++-- .gitignore | 28 +------- .idea/codeStyles/Project.xml | 67 ------------------ .idea/icon.png | Bin 0 -> 33487 bytes CODEOWNERS | 2 +- README.md | 25 ++++++- Writerside/c.list | 6 ++ Writerside/cfg/buildprofiles.xml | 18 +++++ Writerside/doc.tree | 12 ++++ Writerside/images/apollo_logo.svg | 14 ++++ Writerside/images/favicon-192x192.png | Bin 0 -> 16083 bytes Writerside/images/favicon-96x96.png | Bin 0 -> 8084 bytes Writerside/topics/welcome.md | 1 + Writerside/v.list | 6 ++ Writerside/writerside.cfg | 8 +++ 18 files changed, 125 insertions(+), 117 deletions(-) rename .github/workflows/{check-pull-request.yaml => build-pull-request.yaml} (59%) rename .github/workflows/{publish-doc.yaml => publish-docs.yaml} (56%) create mode 100644 .idea/icon.png create mode 100644 Writerside/c.list create mode 100644 Writerside/cfg/buildprofiles.xml create mode 100644 Writerside/doc.tree create mode 100644 Writerside/images/apollo_logo.svg create mode 100644 Writerside/images/favicon-192x192.png create mode 100644 Writerside/images/favicon-96x96.png create mode 100644 Writerside/topics/welcome.md create mode 100644 Writerside/v.list create mode 100644 Writerside/writerside.cfg diff --git a/.github/workflows/check-pull-request.yaml b/.github/workflows/build-pull-request.yaml similarity index 59% rename from .github/workflows/check-pull-request.yaml rename to .github/workflows/build-pull-request.yaml index 2759a9f5..53ac625e 100644 --- a/.github/workflows/check-pull-request.yaml +++ b/.github/workflows/build-pull-request.yaml @@ -1,13 +1,12 @@ -name: check-pull-request +name: Build pull request on: pull_request jobs: - check-pull-request: + build-pull-request: runs-on: macos-latest steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 - run: | - ./gradlew build - ./gradlew -p tests build + ./gradlew build diff --git a/.github/workflows/publish-doc.yaml b/.github/workflows/publish-docs.yaml similarity index 56% rename from .github/workflows/publish-doc.yaml rename to .github/workflows/publish-docs.yaml index f5b45205..4e8b1892 100644 --- a/.github/workflows/publish-doc.yaml +++ b/.github/workflows/publish-docs.yaml @@ -2,11 +2,16 @@ name: Publish documentation on: push: - branches: [ "main" ] + branches: ["main"] workflow_dispatch: +env: + INSTANCE: 'Writerside/doc' + ARTIFACT: 'webHelpDOC2-all.zip' + DOCKER_VERSION: '241.16003' + jobs: - build: + build-docs: runs-on: ubuntu-latest steps: - name: Checkout repository @@ -14,18 +19,25 @@ jobs: with: fetch-depth: 0 + - name: Build docs using Writerside Docker builder + uses: JetBrains/writerside-github-action@5a6920dbce3ef3169acbeb7e45c6cbdaf7e76bfa #v4 + with: + instance: ${{ env.INSTANCE }} + artifact: ${{ env.ARTIFACT }} + docker-version: ${{ env.DOCKER_VERSION }} + - name: Prepare static content run: | - export JAVA_HOME=$JAVA_HOME_21_X64 ./gradlew dokkatooGeneratePublicationHtml mkdir -p build/static - cp -rf build/dokka build/static/kdoc + cp -rf build/dokka/html build/static/kdoc + unzip artifacts/webHelpDOC2-all.zip -d build/static - name: Deploy Kdoc to github pages uses: JamesIves/github-pages-deploy-action@5c6e9e9f3672ce8fd37b9856193d2a537941e66c #v4.6.1 with: branch: gh-pages # The branch the action should deploy to. - folder: build/static/kdoc/html # The folder the action should deploy. + folder: build/static # The folder the action should deploy. - name: Save artifact with build results uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3 @@ -33,4 +45,4 @@ jobs: name: docs path: | artifacts/${{ env.ARTIFACT }} - retention-days: 7 + retention-days: 7 \ No newline at end of file diff --git a/.github/workflows/publish-release.yaml b/.github/workflows/publish-release.yaml index 8f0b2c6c..85bcd28c 100644 --- a/.github/workflows/publish-release.yaml +++ b/.github/workflows/publish-release.yaml @@ -1,4 +1,4 @@ -name: publish-release +name: Publish release on: workflow_dispatch: @@ -13,11 +13,11 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 - run: | - ./gradlew librarianReleaseStagingRepo + ./gradlew librarianPublishToMavenCentral gh release create $GITHUB_REF_NAME --title $GITHUB_REF_NAME --verify-tag --notes-from-tag env: - LIBRARIAN_SONATYPE_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} - LIBRARIAN_SONATYPE_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} - LIBRARIAN_SIGNING_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }} + LIBRARIAN_SONATYPE_USERNAME: ${{ secrets.LIBRARIAN_SONATYPE_USERNAME }} + LIBRARIAN_SONATYPE_PASSWORD: ${{ secrets.LIBRARIAN_SONATYPE_PASSWORD }} + LIBRARIAN_SIGNING_PRIVATE_KEY: ${{ secrets.LIBRARIAN_SIGNING_PRIVATE_KEY }} + LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD }} GH_TOKEN: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/publish-snapshot.yaml b/.github/workflows/publish-snapshot.yaml index 756f356f..7e16006a 100644 --- a/.github/workflows/publish-snapshot.yaml +++ b/.github/workflows/publish-snapshot.yaml @@ -1,4 +1,4 @@ -name: publish-snapshot +name: Publish snapshot on: push: @@ -10,9 +10,9 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 - run: | - ./gradlew librarianPublishToSnapshots + ./gradlew librarianPublishToMavenSnapshots env: - LIBRARIAN_SONATYPE_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} - LIBRARIAN_SONATYPE_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} - LIBRARIAN_SIGNING_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }} + LIBRARIAN_SONATYPE_USERNAME: ${{ secrets.LIBRARIAN_SONATYPE_USERNAME }} + LIBRARIAN_SONATYPE_PASSWORD: ${{ secrets.LIBRARIAN_SONATYPE_PASSWORD }} + LIBRARIAN_SIGNING_PRIVATE_KEY: ${{ secrets.LIBRARIAN_SIGNING_PRIVATE_KEY }} + LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD }} diff --git a/.gitignore b/.gitignore index 9ed93374..3c00b8d8 100644 --- a/.gitignore +++ b/.gitignore @@ -11,40 +11,16 @@ # Generated files build -/reports .kotlin # Place where the Android SDK path is set local.properties -# Secret used by sample apps -github_token - -# XCode +# XCode xcuserdata project.xcworkspace -# Mac OS Finder +# Mac OS Finder .DS_Store Thumbs.db -db.json -*.log - -# Docs -node_modules/ -/docs/public -/docs/.cache -!docs/public/_redirects -.deploy*/ -docs.json -package-lock.json -**/.project -.vscode/** -**/bin -.sqldelight - -# Local Netlify folder -.netlify -# IntelliJ plugin -intellij-plugin/mockJDK diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index d69494f0..aaa48772 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -7,74 +7,7 @@