Skip to content

Commit ad3f4fe

Browse files
committed
Gradle plugin and KMP modules
1 parent 331f895 commit ad3f4fe

37 files changed

Lines changed: 1878 additions & 565 deletions

File tree

.github/workflows/build.yaml

Lines changed: 62 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ env:
1515
LC_ALL: C.UTF-8
1616
LANG: C.UTF-8
1717
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/.vcpkg-cache,readwrite
18-
# ASSEMBLE_ONLY: "true"
1918

2019
jobs:
21-
macos:
22-
name: Build on macOS
23-
runs-on: macos-latest
20+
windows:
21+
name: Build on Windows
22+
runs-on: windows-latest
2423
steps:
2524
- name: Checkout
2625
uses: actions/checkout@v4
@@ -58,30 +57,28 @@ jobs:
5857
cache: gradle
5958
check-latest: true
6059
- name: Build
61-
run: ./gradlew --no-daemon assembleAll
62-
- name: Publish package
63-
run: ./gradlew --no-daemon publishToMavenCentral
64-
env:
65-
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.PUBLICATION_USERNAME }}
66-
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.PUBLICATION_PASSWORD }}
67-
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
68-
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY_RING }}
69-
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
60+
run: ./gradlew --no-daemon assembleProjects
61+
- name: Upload artifacts
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: "artifacts-windows"
65+
path: "generated-kotlin-wrappers"
66+
if-no-files-found: "ignore"
7067
- name: Bundle the build report
7168
if: failure()
7269
run: find . -type d -name 'reports' | zip -@ -r build-report.zip
7370
- name: Upload the build report
7471
if: failure()
7572
uses: actions/upload-artifact@master
7673
with:
77-
name: build-report
74+
name: build-report-windows
7875
path: |
7976
build-report.zip
80-
vcpkg/buildtrees/**/*.log
77+
vcpkg/buildtrees/*/*.log
8178
82-
windows:
83-
name: Build on Windows
84-
runs-on: windows-latest
79+
linux:
80+
name: Build on Linux
81+
runs-on: ubuntu-latest
8582
steps:
8683
- name: Checkout
8784
uses: actions/checkout@v4
@@ -100,6 +97,13 @@ jobs:
10097
vcpkg/buildtrees
10198
vcpkg/downloads
10299
key: ${{ runner.os }}-${{ runner.arch }}
100+
- name: Install build tools
101+
env:
102+
DEBIAN_FRONTEND: noninteractive
103+
TZ: Etc/UTC
104+
run: |
105+
sudo apt-get update
106+
sudo apt-get install -y git build-essential crossbuild-essential-arm64 pkg-config curl zip unzip tar
103107
- name: Setup vcpkg
104108
run: |
105109
cd vcpkg
@@ -109,6 +113,13 @@ jobs:
109113
git fetch base master
110114
git rebase base/master
111115
./bootstrap-vcpkg.sh -disableMetrics
116+
- name: Install emsdk
117+
run: |
118+
git clone https://github.com/emscripten-core/emsdk.git
119+
cd emsdk
120+
./emsdk install latest
121+
./emsdk activate latest
122+
source ./emsdk_env.sh
112123
- name: Validate Gradle Wrapper
113124
uses: gradle/actions/wrapper-validation@v4
114125
- name: Install JDK
@@ -119,30 +130,33 @@ jobs:
119130
cache: gradle
120131
check-latest: true
121132
- name: Build
122-
run: ./gradlew --no-daemon assembleAll
123-
- name: Publish package
124-
run: ./gradlew --no-daemon publishToMavenCentral
125-
env:
126-
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.PUBLICATION_USERNAME }}
127-
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.PUBLICATION_PASSWORD }}
128-
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
129-
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY_RING }}
130-
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
133+
run: |
134+
source ./emsdk/emsdk_env.sh
135+
./gradlew --no-daemon assembleProjects
136+
- name: Upload artifacts
137+
uses: actions/upload-artifact@v4
138+
with:
139+
name: "artifacts-linux"
140+
path: "generated-kotlin-wrappers"
141+
if-no-files-found: "ignore"
131142
- name: Bundle the build report
132143
if: failure()
133144
run: find . -type d -name 'reports' | zip -@ -r build-report.zip
134145
- name: Upload the build report
135146
if: failure()
136147
uses: actions/upload-artifact@master
137148
with:
138-
name: build-report
149+
name: build-report-linux
139150
path: |
140151
build-report.zip
141152
vcpkg/buildtrees/*/*.log
142153
143-
linux:
144-
name: Build on Linux
145-
runs-on: ubuntu-latest
154+
macos:
155+
name: Build on macOS
156+
runs-on: macos-latest
157+
needs:
158+
- linux
159+
- windows
146160
steps:
147161
- name: Checkout
148162
uses: actions/checkout@v4
@@ -161,13 +175,6 @@ jobs:
161175
vcpkg/buildtrees
162176
vcpkg/downloads
163177
key: ${{ runner.os }}-${{ runner.arch }}
164-
- name: Install build tools
165-
env:
166-
DEBIAN_FRONTEND: noninteractive
167-
TZ: Etc/UTC
168-
run: |
169-
sudo apt-get update
170-
sudo apt-get install -y git build-essential crossbuild-essential-arm64 pkg-config curl zip unzip tar
171178
- name: Setup vcpkg
172179
run: |
173180
cd vcpkg
@@ -177,13 +184,6 @@ jobs:
177184
git fetch base master
178185
git rebase base/master
179186
./bootstrap-vcpkg.sh -disableMetrics
180-
- name: Install emsdk
181-
run: |
182-
git clone https://github.com/emscripten-core/emsdk.git
183-
cd emsdk
184-
./emsdk install latest
185-
./emsdk activate latest
186-
source ./emsdk_env.sh
187187
- name: Validate Gradle Wrapper
188188
uses: gradle/actions/wrapper-validation@v4
189189
- name: Install JDK
@@ -194,12 +194,23 @@ jobs:
194194
cache: gradle
195195
check-latest: true
196196
- name: Build
197-
run: |
198-
source ./emsdk/emsdk_env.sh
199-
./gradlew --no-daemon assembleAll
200-
- name: Publish package
197+
run: ./gradlew --no-daemon assembleProjects
198+
- name: Download all build artifacts
199+
uses: actions/download-artifact@v4
200+
with:
201+
pattern: "artifacts-*"
202+
path: "generated-kotlin-wrappers"
203+
merge-multiple: true
204+
- name: Generate wrappers
205+
run: ./gradlew --no-daemon generateBuildScripts
206+
- name: Build wrappers
207+
run: ./gradlew --no-daemon assemble
208+
env:
209+
PUBLISHING: "true"
210+
- name: Publish
201211
run: ./gradlew --no-daemon publishToMavenCentral
202212
env:
213+
PUBLISHING: "true"
203214
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.PUBLICATION_USERNAME }}
204215
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.PUBLICATION_PASSWORD }}
205216
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
@@ -212,53 +223,7 @@ jobs:
212223
if: failure()
213224
uses: actions/upload-artifact@master
214225
with:
215-
name: build-report
226+
name: build-report-macos
216227
path: |
217228
build-report.zip
218-
vcpkg/buildtrees/*/*.log
219-
220-
# aggregate:
221-
# runs-on: ubuntu-latest
222-
# needs:
223-
# - macos
224-
# - linux
225-
# - windows
226-
# env:
227-
# ASSEMBLE_ONLY: "false"
228-
# steps:
229-
# - name: Checkout
230-
# uses: actions/checkout@v4
231-
# - name: Validate Gradle Wrapper
232-
# uses: gradle/actions/wrapper-validation@v4
233-
# - name: Install JDK
234-
# uses: actions/setup-java@v4
235-
# with:
236-
# java-version: "17"
237-
# distribution: "temurin"
238-
# cache: gradle
239-
# check-latest: true
240-
# - name: Download all build artifacts
241-
# uses: actions/download-artifact@v4
242-
# with:
243-
# pattern: "artifacts-*"
244-
# path: "build/nativebuilds"
245-
# merge-multiple: true
246-
# - name: Publish package
247-
# run: ./gradlew --no-daemon publishToMavenCentral
248-
# env:
249-
# ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.PUBLICATION_USERNAME }}
250-
# ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.PUBLICATION_PASSWORD }}
251-
# ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
252-
# ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY_RING }}
253-
# ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
254-
# - name: Bundle the build report
255-
# if: failure()
256-
# run: find . -type d -name 'reports' | zip -@ -r build-report.zip
257-
# - name: Upload the build report
258-
# if: failure()
259-
# uses: actions/upload-artifact@master
260-
# with:
261-
# name: build-report
262-
# path: |
263-
# build-report.zip
264-
# vcpkg/buildtrees/*/*.log
229+
vcpkg/buildtrees/**/*.log
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: gradle-plugin
2+
3+
env:
4+
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
5+
RUNNING_ON_CI: "true"
6+
LC_ALL: C.UTF-8
7+
LANG: C.UTF-8
8+
9+
on:
10+
push:
11+
# tags:
12+
# - v-*
13+
pull_request:
14+
15+
jobs:
16+
build:
17+
name: Build and test
18+
runs-on: macos-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
repository: ensody/vcpkg
26+
path: vcpkg
27+
fetch-depth: 0
28+
- name: Validate Gradle Wrapper
29+
uses: gradle/actions/wrapper-validation@v4
30+
- name: Install JDK
31+
uses: actions/setup-java@v4
32+
with:
33+
java-version: "17"
34+
distribution: "temurin"
35+
cache: "gradle"
36+
check-latest: true
37+
- name: Configure Gradle
38+
run:
39+
./gradlew help
40+
./gradlew --version
41+
- name: Build project
42+
run: ./gradlew build-logic:native-builds-gradle-plugin:assemble --stacktrace
43+
- name: Publish package
44+
if: startsWith(github.ref, 'refs/tags/v-')
45+
run: OVERRIDE_VERSION="$(git tag --points-at HEAD)" ./gradlew build-logic:native-builds-gradle-plugin:publishToMavenCentral
46+
env:
47+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.PUBLICATION_USERNAME }}
48+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.PUBLICATION_PASSWORD }}
49+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
50+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY_RING }}
51+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
52+
53+
- name: Bundle the build report
54+
if: failure()
55+
run: find . -type d -name 'reports' | zip -@ -r build-report.zip
56+
- name: Upload the build report
57+
if: failure()
58+
uses: actions/upload-artifact@master
59+
with:
60+
name: build-report
61+
path: build-report.zip

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ kotlin-js-store
2020
Pods
2121

2222
/vcpkg
23+
/vcpkg-tool
2324
/vcpkg_installed
25+
/generated-kotlin-wrappers

0 commit comments

Comments
 (0)