Skip to content

Commit 569259d

Browse files
authored
devops: auto update browser versions in readme (#153)
1 parent ef6adb8 commit 569259d

File tree

11 files changed

+156
-35
lines changed

11 files changed

+156
-35
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Playwright is a Java library to automate [Chromium](https://www.chromium.org/Hom
99
| | Linux | macOS | Windows |
1010
| :--- | :---: | :---: | :---: |
1111
| Chromium <!-- GEN:chromium-version -->89.0.4344.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
12-
| WebKit 14.1 | :white_check_mark: | :white_check_mark: | :white_check_mark: |
12+
| WebKit <!-- GEN:webkit-version -->14.1<!-- GEN:stop --> | | | |
1313
| Firefox <!-- GEN:firefox-version -->84.0b9<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1414

1515
Headless execution is supported for all the browsers on all platforms. Check out [system requirements](https://playwright.dev/#?path=docs/intro.md&q=system-requirements) for details.

pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
</scm>
3737

3838
<modules>
39-
<module>api-generator</module>
4039
<module>driver</module>
4140
<module>driver-bundle</module>
4241
<module>playwright</module>

scripts/generate_api.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ cd "$(dirname $0)/.."
99
PLAYWRIGHT_CLI=./driver-bundle/src/main/resources/driver/linux/playwright-cli
1010
echo "Updating api.json from $($PLAYWRIGHT_CLI --version)"
1111

12-
$PLAYWRIGHT_CLI print-api-json > ./api-generator/src/main/resources/api.json
12+
$PLAYWRIGHT_CLI print-api-json > ./tools/api-generator/src/main/resources/api.json
1313

14-
mvn compile -projects api-generator --no-transfer-progress
14+
mvn compile -f ./tools/api-generator --no-transfer-progress
1515

1616
echo "Regenerating Java interfaces"
17-
mvn exec:java --projects api-generator -Dexec.mainClass=com.microsoft.playwright.tools.ApiGenerator
17+
mvn exec:java --f ./tools/api-generator -Dexec.mainClass=com.microsoft.playwright.tools.ApiGenerator

scripts/set_maven_version.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set +x
5+
6+
if [[ $# == 0 ]]; then
7+
echo "Missing version parameter."
8+
echo "Usage:"
9+
echo " $(basename $0) 0.170.3-SNAPSHOT"
10+
exit 1
11+
fi
12+
13+
trap "cd $(pwd -P)" EXIT
14+
cd "$(dirname $0)/.."
15+
16+
VERSION=$1
17+
18+
mvn versions:set -DnewVersion=$VERSION
19+
20+
cd tools/api-generator
21+
mvn versions:set -DnewVersion=$VERSION
22+
23+
cd -
24+
cd tools/update-docs-version
25+
mvn versions:set -DnewVersion=$VERSION

scripts/update_api.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set +x
5+
6+
trap "cd $(pwd -P)" EXIT
7+
8+
cd "$(dirname $0)/.."
9+
10+
./scripts/generate_api.sh
11+
12+
# Built from source and do local install.
13+
mvn clean install --no-transfer-progress -DskipTests
14+
15+
echo "Updating browser versions in README.md"
16+
mvn exec:java --f ./tools/update-docs-version -Dexec.mainClass=com.microsoft.playwright.tools.UpdateBrowserVersions
Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,38 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7-
<parent>
8-
<groupId>com.microsoft.playwright</groupId>
9-
<artifactId>parent-pom</artifactId>
10-
<version>0.170.3-SNAPSHOT</version>
11-
</parent>
12-
7+
<groupId>com.microsoft.playwright</groupId>
138
<artifactId>api-generator</artifactId>
9+
<version>0.170.3-SNAPSHOT</version>
1410
<name>Playwright - API Generator</name>
15-
<description>Java library to automate Chromium, Firefox and WebKit with a single API.
16-
Playwright is built to enable cross-browser web automation that is ever-green, capable,
17-
reliable and fast.
18-
11+
<description>
1912
This is an internal module used to generate Java API from the upstream Playwright
2013
definitions. It's an internal development module not intended for external use.
2114
</description>
15+
<properties>
16+
<compiler.version>1.8</compiler.version>
17+
<gson.version>2.8.6</gson.version>
18+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19+
</properties>
2220

2321
<build>
2422
<plugins>
2523
<plugin>
2624
<groupId>org.apache.maven.plugins</groupId>
27-
<artifactId>maven-source-plugin</artifactId>
28-
</plugin>
29-
<plugin>
30-
<groupId>org.apache.maven.plugins</groupId>
31-
<artifactId>maven-javadoc-plugin</artifactId>
25+
<artifactId>maven-compiler-plugin</artifactId>
26+
<version>3.1</version>
3227
<configuration>
33-
<source>8</source>
34-
<failOnError>false</failOnError>
28+
<source>${compiler.version}</source>
29+
<target>${compiler.version}</target>
3530
</configuration>
36-
<executions>
37-
<execution>
38-
<id>attach-javadocs</id>
39-
<goals>
40-
<goal>jar</goal>
41-
</goals>
42-
</execution>
43-
</executions>
44-
</plugin>
45-
<plugin>
46-
<groupId>org.apache.maven.plugins</groupId>
47-
<artifactId>maven-compiler-plugin</artifactId>
4831
</plugin>
4932
</plugins>
5033
</build>
5134
<dependencies>
5235
<dependency>
5336
<groupId>com.google.code.gson</groupId>
5437
<artifactId>gson</artifactId>
38+
<version>${gson.version}</version>
5539
</dependency>
5640
</dependencies>
5741
</project>

api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java renamed to tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ public class ApiGenerator {
12021202
public static void main(String[] args) throws IOException {
12031203
File cwd = FileSystems.getDefault().getPath(".").toFile();
12041204
System.out.println(cwd.getCanonicalPath());
1205-
File file = new File(cwd, "api-generator/src/main/resources/api.json");
1205+
File file = new File(cwd, "tools/api-generator/src/main/resources/api.json");
12061206
System.out.println("Reading from: " + file.getCanonicalPath());
12071207
new ApiGenerator(new FileReader(file));
12081208
}

api-generator/src/main/java/com/microsoft/playwright/tools/Types.java renamed to tools/api-generator/src/main/java/com/microsoft/playwright/tools/Types.java

File renamed without changes.
File renamed without changes.

tools/update-docs-version/pom.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.microsoft.playwright</groupId>
8+
<artifactId>update-version</artifactId>
9+
<version>0.170.3-SNAPSHOT</version>
10+
<name>Playwright - Update Version in Documentation</name>
11+
<description>
12+
This is an internal module used to update versions in the documentation based on
13+
current driver.
14+
</description>
15+
<properties>
16+
<compiler.version>1.8</compiler.version>
17+
<gson.version>2.8.6</gson.version>
18+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19+
</properties>
20+
21+
<build>
22+
<plugins>
23+
<plugin>
24+
<groupId>org.apache.maven.plugins</groupId>
25+
<artifactId>maven-compiler-plugin</artifactId>
26+
<version>3.1</version>
27+
<configuration>
28+
<source>${compiler.version}</source>
29+
<target>${compiler.version}</target>
30+
</configuration>
31+
</plugin>
32+
</plugins>
33+
</build>
34+
<dependencies>
35+
<dependency>
36+
<groupId>com.microsoft.playwright</groupId>
37+
<artifactId>playwright</artifactId>
38+
<version>${project.version}</version>
39+
</dependency>
40+
</dependencies>
41+
</project>

0 commit comments

Comments
 (0)