Skip to content

Commit f706f7f

Browse files
committed
Some cleanup
1 parent e678dd6 commit f706f7f

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

scripts/publish-module.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ afterEvaluate {
4646
}
4747
}
4848

49+
nexusPublishing {
50+
useStaging.convention(project.provider {
51+
def isSnapshot = PUBLISH_VERSION.endsWith("-SNAPSHOT")
52+
println("Is snapshot: $isSnapshot. Version: $PUBLISH_VERSION")
53+
!isSnapshot
54+
})
55+
}
56+
4957
signing {
5058
useInMemoryPgpKeys(
5159
rootProject.ext["signing.keyId"],

scripts/publish-root.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,4 @@ nexusPublishing {
3131
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
3232
}
3333
}
34-
useStaging.convention(project.provider {
35-
!project.hasProperty("snapshot")
36-
})
3734
}

scripts/release_sdk.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,14 @@ def get_asset_path(root_project_dir: str, module: Module) -> str:
153153
raise ValueError(f"Unknown module: {module}")
154154

155155

156-
def get_publish_task(module: Module, is_snapshot: bool) -> str:
156+
def get_publish_task(module: Module) -> str:
157157
if module == Module.SDK:
158-
command = ":sdk:sdk-android:publishToSonatype"
158+
return ":sdk:sdk-android:publishToSonatype"
159159
elif module == Module.CRYPTO:
160-
command = ":crypto:crypto-android:publishToSonatype"
160+
return ":crypto:crypto-android:publishToSonatype"
161161
else:
162162
raise ValueError(f"Unknown module: {module}")
163163

164-
if is_snapshot:
165-
return f"{command} -Psnapshot"
166-
else:
167-
return command
168-
169164

170165
def run_publish_close_and_release_tasks(root_project_dir, publish_task: str):
171166
gradle_command = f"./gradlew {publish_task} closeAndReleaseStagingRepository"
@@ -216,7 +211,7 @@ def main(args: argparse.Namespace):
216211
# First release on Maven
217212
run_publish_close_and_release_tasks(
218213
project_root,
219-
get_publish_task(args.module, args.version.endswith("-SNAPSHOT")),
214+
get_publish_task(args.module),
220215
)
221216

222217
if not args.version.endswith("-SNAPSHOT"):

0 commit comments

Comments
 (0)