Skip to content

Commit b24d454

Browse files
committed
Bump async-profiler to 4.1
1 parent 16c6625 commit b24d454

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ from maven central, e.g:
5050
<dependency>
5151
<groupId>me.bechberger</groupId>
5252
<artifactId>ap-loader-all</artifactId>
53-
<version>4.0-10</version>
53+
<version>4.1-10</version>
5454
</dependency>
5555
```
5656

57-
Others are of course available, see [maven central](https://central.sonatype.com/artifact/me.bechberger/ap-loader-all/4.0-10).
57+
Others are of course available, see [maven central](https://central.sonatype.com/artifact/me.bechberger/ap-loader-all/4.1-10).
5858

5959
You can also use [JBang](https://jbang.dev) to simplify the usage of ap-loader. There are examples in documentation below.
6060

@@ -234,7 +234,7 @@ The latest `all` version can be added via:
234234
<dependency>
235235
<groupId>me.bechberger</groupId>
236236
<artifactId>ap-loader-all</artifactId>
237-
<version>4.0-10</version>
237+
<version>4.1-10</version>
238238
</dependency>
239239
```
240240
@@ -248,16 +248,16 @@ It requires a platform supported by async-profiler and Python 3.6+.
248248
249249
```sh
250250
# download the release sources and binaries
251-
python3 ./bin/releaser.py download 4.0
251+
python3 ./bin/releaser.py download 4.1
252252

253253
# build the JAR for the release
254254
# maven might throw warnings, related to the project version setting,
255255
# but the alternative solutions don't work, so we ignore the warning for now
256-
mvn -Dproject.vversion=4.0 -Dproject.subrelease=10 -Dproject.platform=macos package assembly:single
256+
mvn -Dproject.vversion=4.1 -Dproject.subrelease=10 -Dproject.platform=macos package assembly:single
257257
# use it
258-
java -jar target/ap-loader-macos-4.0-10-full.jar ...
258+
java -jar target/ap-loader-macos-4.1-10-full.jar ...
259259
# build the all JAR
260-
mvn -Dproject.vversion=4.0 -Dproject.subrelease=10 -Dproject.platform=all package assembly:single
260+
mvn -Dproject.vversion=4.1 -Dproject.subrelease=10 -Dproject.platform=all package assembly:single
261261
```
262262
263263
Development

bin/releaser.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ def release_platform_for_url(archive_url: str) -> str:
199199

200200

201201
def get_release_platforms(tool: Tool, release: str) -> List[str]:
202-
return [release_platform_for_url(url) for url in
203-
get_release_asset_urls(tool, release)]
202+
return [platform for platform in [release_platform_for_url(url) for url in
203+
get_release_asset_urls(tool, release)] if "debug" not in platform]
204204

205205

206206
def get_ending(url: str) -> str:
@@ -211,6 +211,7 @@ def get_ending(url: str) -> str:
211211

212212
def download_latest_jattach(dest_path: Path, platform: str):
213213
""" Download the latest jattach release from GitHub """
214+
print(f"Download latest jattach for {platform} to {dest_path}")
214215
release = get_most_recent_release(Tool.JATTACH)
215216
urls = get_release_asset_urls(Tool.JATTACH, release)
216217
url = ([url for url in urls if
@@ -236,6 +237,7 @@ def download_release_url(release: str, release_url: str):
236237
os.makedirs(dest_folder, exist_ok=True)
237238
ending = get_ending(release_url)
238239
platform = release_platform_for_url(release_url)
240+
print(f"Download {release} for {platform} from {release_url}")
239241
archive_file = f"{dest_folder}/async-profiler-{release}-{platform}{ending}"
240242
if not os.path.exists(archive_file):
241243
request.urlretrieve(release_url, archive_file)
@@ -246,11 +248,11 @@ def download_release_url(release: str, release_url: str):
246248
else:
247249
raise Exception("Unknown archive type for " + release_url)
248250
# if dest-folder doesn't contain jattach for this platform, download it
249-
if not os.path.exists(
250-
f"{dest_folder}/async-profiler-{release}-{platform}/build/jattach"):
251-
download_latest_jattach(Path(
252-
f"{dest_folder}/async-profiler-{release}-{platform}/build/jattach"),
253-
platform)
251+
jattach = f"{dest_folder}/async-profiler-{release}-{platform}/build/jattach"
252+
if not os.path.exists(jattach):
253+
print(f"jattach not found in {jattach}, downloading it")
254+
download_latest_jattach(Path(jattach), platform)
255+
assert os.path.exists(jattach), "jattach not found in " + jattach
254256

255257

256258
def download_release_code(release: str):
@@ -270,6 +272,8 @@ def download_release_code(release: str):
270272

271273
def download_release(release: str):
272274
for release_url in get_release_asset_urls(Tool.ASYNC_PROFILER, release):
275+
if "debug" in release_url:
276+
continue
273277
download_release_url(release, release_url)
274278
download_release_code(release)
275279

@@ -564,4 +568,4 @@ def cli():
564568

565569

566570
if __name__ == "__main__":
567-
cli()
571+
cli()

0 commit comments

Comments
 (0)