-
Notifications
You must be signed in to change notification settings - Fork 388
Expand file tree
/
Copy pathdiff.txt
More file actions
394 lines (379 loc) · 15 KB
/
diff.txt
File metadata and controls
394 lines (379 loc) · 15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
diff --git a/build.gradle b/build.gradle
index c192aca42a..a882c146a3 100644
--- a/build.gradle
+++ b/build.gradle
@@ -8,12 +8,16 @@
}
}
+plugins {
+ id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
+}
+
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
group = 'com.eclipsesource.j2v8'
-version = System.getenv('J2V8_FULL_VERSION') ?: '0.0.0-local'
+version = System.getenv('J2V8_FULL_VERSION') ?: '6.3.2'
base {
archivesName = 'j2v8'
@@ -97,33 +101,22 @@
}
}
}
-
- repositories {
- if (System.getenv('MAVEN_REPO_USER') && System.getenv('MAVEN_REPO_PASS')) {
- maven {
- name = 'sonatype'
- url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
- credentials {
- username = System.getenv('MAVEN_REPO_USER')
- password = System.getenv('MAVEN_REPO_PASS')
- }
- }
-
- maven {
- name = 'sonatypeSnapshots'
- url = 'https://oss.sonatype.org/content/repositories/snapshots/'
- credentials {
- username = System.getenv('MAVEN_REPO_USER')
- password = System.getenv('MAVEN_REPO_PASS')
- }
- }
- }
+ }
+
+ signing {
+ if (findProperty('signing.keyId')) {
+ sign publishing.publications.release
}
}
}
-signing {
- if (findProperty('signing.keyId')) {
- sign publishing.publications.release
+nexusPublishing {
+ repositories {
+ central {
+ nexusUrl.set(uri("https://central.sonatype.com/api/v1/publisher/"))
+ snapshotRepositoryUrl.set(uri("https://central.sonatype.com/api/v1/publisher/"))
+ username = System.getenv('MAVEN_REPO_USER')
+ password = System.getenv('MAVEN_REPO_PASS')
+ }
}
}
diff --git a/build_system/build_constants.py b/build_system/build_constants.py
index 16c6b61aec..059558d709 100644
--- a/build_system/build_constants.py
+++ b/build_system/build_constants.py
@@ -27,6 +27,8 @@
" For the execution of this build-step Maven (Java) or Gradle (Android) are used for the respective target platforms."),
CLIStep(c.build_j2v8_package, " Packages all previously built native libraries (from multiple architectures) into a single multi-architecture artifact.\n" +
" This step does not run 'clean', preserving all native libraries in src/main/jniLibs/. Does not require --arch parameter."),
+ CLIStep(c.build_j2v8_publish, " Publishes the J2V8 package to Maven Central Portal.\n" +
+ " Updates pom.xml with artifact metadata, creates bundle with all required files (pom.xml, AAR, sources, javadoc, signatures), and uploads to Maven Central."),
CLIStep(c.build_j2v8_test, " Runs the Java (JUnit/Gradle) unit tests."),
CLIStep(c.build_j2v8_release, " Release J2V8."),
]
diff --git a/build_system/build_settings.py b/build_system/build_settings.py
index 621a210077..5f3fb412d0 100644
--- a/build_system/build_settings.py
+++ b/build_system/build_settings.py
@@ -16,7 +16,7 @@
# J2V8 settings
#-----------------------------------------------------------------------
-J2V8_VERSION_MAJOR, J2V8_VERSION_MINOR, J2V8_VERSION_PATCH = 6, 2, 1
+J2V8_VERSION_MAJOR, J2V8_VERSION_MINOR, J2V8_VERSION_PATCH = 6, 3, 4
# J2V8_VERSION_SUFFIX = "-SNAPSHOT"
J2V8_VERSION_SUFFIX = ""
diff --git a/build_system/config_android.py b/build_system/config_android.py
index a474ecbd3f..0db378adcb 100644
--- a/build_system/config_android.py
+++ b/build_system/config_android.py
@@ -148,11 +148,39 @@
android_config.build_step(c.build_j2v8_test, build_j2v8_test)
#-----------------------------------------------------------------------
+def build_j2v8_publish(config):
+ """
+ Publish Android AAR to Maven Central Portal.
+ Publishes the multi-architecture AAR as a single 'j2v8' artifact.
+ Note: Run 'j2v8package' first to create the multi-arch AAR with all native libraries.
+ """
+ # Update Maven pom.xml settings (modifies file in place)
+ u.apply_maven_config_settings(config)
+
+ # Use simple artifact ID without platform/architecture
+ artifact_id = "j2v8"
+ version = u.s.J2V8_FULL_VERSION
+
+ return \
+ u.setEnvVar("ARTIFACT_ID", artifact_id) + \
+ u.setEnvVar("VERSION", version) + [
+ "rm -rf target/*",
+ "mkdir -p target",
+ "cp build/outputs/aar/j2v8-release.aar target/$ARTIFACT_ID-$VERSION.aar",
+ "cp pom.xml target/$ARTIFACT_ID-$VERSION.pom",
+ "sed -i.bak 's|<packaging>pom</packaging>|<packaging>aar</packaging>|' target/$ARTIFACT_ID-$VERSION.pom && rm target/$ARTIFACT_ID-$VERSION.pom.bak",
+ "mvn package -Prelease -Dgpg.skip=true",
+ "cd target && rm -f $ARTIFACT_ID-$VERSION.pom.asc $ARTIFACT_ID-$VERSION.pom.md5 $ARTIFACT_ID-$VERSION.pom.sha1 && for file in *.jar *.aar *.pom; do [ -f \"$file\" ] && gpg --batch --passphrase \"$KEYSTORE_PASSWORD\" -ab \"$file\" && md5sum \"$file\" | awk '{print $1}' > \"${file}.md5\" && shasum -a 1 \"$file\" | awk '{print $1}' > \"${file}.sha1\"; done && cd ..",
+ "mvn assembly:single@create-central-bundle -Prelease",
+ "mvn deploy -Prelease -Dgpg.skip=true"
+ ]
+
+android_config.build_step(c.build_j2v8_publish, build_j2v8_publish)
+#-----------------------------------------------------------------------
def build_j2v8_release(config):
return \
u.setVersionEnv(config) + \
- u.gradle(" uploadArchives")
+ u.gradle("publish")
android_config.build_step(c.build_j2v8_release, build_j2v8_release)
#-----------------------------------------------------------------------
-
diff --git a/build_system/constants.py b/build_system/constants.py
index bc8fc9c3ee..8403575de0 100644
--- a/build_system/constants.py
+++ b/build_system/constants.py
@@ -25,6 +25,7 @@
build_j2v8_optimize = 'j2v8optimize'
build_j2v8_java = 'j2v8java'
build_j2v8_package = 'j2v8package'
+build_j2v8_publish = 'j2v8publish'
build_j2v8_test = 'j2v8test'
build_j2v8_release = 'j2v8release'
diff --git a/build_system/shared_build_steps.py b/build_system/shared_build_steps.py
index ae0f4440ab..9dce56188c 100644
--- a/build_system/shared_build_steps.py
+++ b/build_system/shared_build_steps.py
@@ -185,14 +185,16 @@
os = config.inject_env("$VENDOR-$PLATFORM")
arch = config.file_abi
version = s.J2V8_FULL_VERSION
- name = config.inject_env("j2v8_$VENDOR-$PLATFORM_$FILE_ABI")
+ # Use simple "j2v8" artifact ID for single multi-arch AAR
+ artifact_id = "j2v8"
+ name = "j2v8"
maven_settings = {
"properties": {
"os": os,
"arch": arch,
},
- "artifactId": name,
+ "artifactId": artifact_id,
"version": version,
"name": name,
}
diff --git a/diff.txt b/diff.txt
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/pom.xml b/pom.xml
index 4a5126dd8a..2c46a0e7de 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,17 +3,17 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <os>macos</os>
+ <os>android</os>
<ws>gtk</ws>
- <arch>aarch_64</arch>
+ <arch>arm64-v8a</arch>
</properties>
<groupId>com.eclipsesource.j2v8</groupId>
- <artifactId>j2v8_macos_aarch_64</artifactId>
- <version>6.2.1</version>
- <packaging>bundle</packaging>
+ <artifactId>j2v8</artifactId>
+ <version>6.3.4</version>
+ <packaging>pom</packaging>
- <name>j2v8_macos_aarch_64</name>
+ <name>j2v8</name>
<description>J2V8 is a set of Java bindings for V8</description>
<url>https://github.com/eclipsesource/j2v8</url>
<licenses>
@@ -52,14 +52,7 @@
</dependencies>
<distributionManagement>
- <snapshotRepository>
- <id>ossrh</id>
- <url>https://oss.sonatype.org/content/repositories/snapshots</url>
- </snapshotRepository>
- <repository>
- <id>ossrh</id>
- <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
- </repository>
+
</distributionManagement>
<build>
@@ -75,6 +68,17 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.3.0</version>
+ <executions>
+ <execution>
+ <id>default-jar</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
@@ -110,15 +114,87 @@
<build>
<plugins>
<plugin>
- <groupId>org.sonatype.plugins</groupId>
- <artifactId>nexus-staging-maven-plugin</artifactId>
- <version>1.6.3</version>
- <extensions>true</extensions>
- <configuration>
- <serverId>ossrh</serverId>
- <nexusUrl>https://oss.sonatype.org/</nexusUrl>
- <autoReleaseAfterClose>true</autoReleaseAfterClose>
- </configuration>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>3.4.0</version>
+ <executions>
+ <execution>
+ <id>attach-aar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>${project.build.directory}/${project.artifactId}-${project.version}.aar</file>
+ <type>aar</type>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>3.6.0</version>
+ <executions>
+ <execution>
+ <id>create-central-bundle</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/central-bundle.xml</descriptor>
+ </descriptors>
+ <appendAssemblyId>true</appendAssemblyId>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>3.1.0</version>
+ <executions>
+ <execution>
+ <id>upload-to-central-portal</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ <configuration>
+ <executable>curl</executable>
+ <arguments>
+ <argument>--request</argument>
+ <argument>POST</argument>
+ <argument>--verbose</argument>
+ <argument>--header</argument>
+ <argument>Authorization: Bearer ${env.MAVEN_REPO_TOKEN}</argument>
+ <argument>--form</argument>
+ <argument>bundle=@${project.build.directory}/${project.artifactId}-${project.version}-central-bundle.zip</argument>
+ <argument>https://central.sonatype.com/api/v1/publisher/upload?name=${project.artifactId}&publishingType=AUTOMATIC</argument>
+ </arguments>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -150,6 +226,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
+ <configuration>
+ <keyname>${env.KEY_ID}</keyname>
+ <passphrase>${env.KEYSTORE_PASSWORD}</passphrase>
+ </configuration>
<executions>
<execution>
<id>sign-artifacts</id>
diff --git a/src/assembly/central-bundle.xml b/src/assembly/central-bundle.xml
new file mode 100644
index 0000000000..c77e0a3c81
--- /dev/null
+++ b/src/assembly/central-bundle.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
+ <id>central-bundle</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <files>
+ <!-- Include modified POM from target with proper Maven naming -->
+ <file>
+ <source>${project.build.directory}/${project.artifactId}-${project.version}.pom</source>
+ <destName>${project.artifactId}-${project.version}.pom</destName>
+ <outputDirectory>com/eclipsesource/j2v8/${project.artifactId}/${project.version}</outputDirectory>
+ </file>
+ </files>
+ <fileSets>
+ <!-- Include artifacts from target directory -->
+ <fileSet>
+ <directory>${project.build.directory}</directory>
+ <outputDirectory>com/eclipsesource/j2v8/${project.artifactId}/${project.version}</outputDirectory>
+ <includes>
+ <!-- Main artifact (AAR/JAR/bundle) -->
+ <include>${project.artifactId}-${project.version}.aar</include>
+ <include>${project.artifactId}-${project.version}.jar</include>
+ <!-- Sources JAR -->
+ <include>${project.artifactId}-${project.version}-sources.jar</include>
+ <!-- Javadoc JAR -->
+ <include>${project.artifactId}-${project.version}-javadoc.jar</include>
+ <!-- GPG signatures -->
+ <include>*.asc</include>
+ <!-- Checksums -->
+ <include>*.md5</include>
+ <include>*.sha1</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly>