-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support two modes of okhttp instrumentation via plugin + wire up release pipeline #144
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ readonly remote_location_root_prefix="s3://bitdrift-public-dl/sdk/android-maven/ | |
readonly version="$1" | ||
readonly capture_archive="$2" | ||
readonly capture_timber_archive="$3" | ||
readonly capture_plugin_archive="$4" | ||
|
||
function upload_file() { | ||
local -r location="$1" | ||
|
@@ -78,36 +79,28 @@ function release_capture_sdk() { | |
popd | ||
} | ||
|
||
function release_capture_timber() { | ||
function release_gradle_library() { | ||
local -r library_name="$1" | ||
local -r archive="$2" | ||
|
||
echo "+++ dl.bitdrift.io Android Capture Timber artifacts upload" | ||
|
||
# We get a zip containing the artifacts named per Maven conventions. | ||
local -r remote_location_prefix="$remote_location_root_prefix/$library_name" | ||
|
||
pushd "$(mktemp -d)" | ||
unzip -o "$sdk_repo/$capture_timber_archive" | ||
|
||
echo "+++ Uploading artifacts to s3 bucket" | ||
unzip -o "$archive" | ||
|
||
# Make sure we update the top-level maven-metadata.xml file with the new release version | ||
aws s3 cp maven-metadata.xml* "$remote_location_prefix/" --region us-east-1 | ||
|
||
local -r remote_location_prefix="$remote_location_root_prefix/capture-timber" | ||
local -r name="capture-timber-$version" | ||
# Update the per-version files | ||
aws s3 cp "$sdk_repo/ci/LICENSE.txt" "$remote_location_prefix/$version/LICENSE.txt" --region us-east-1 | ||
aws s3 cp "$sdk_repo/ci/NOTICE.txt" "$remote_location_prefix/$version/NOTICE.txt" --region us-east-1 | ||
|
||
files=(\ | ||
"$sdk_repo/ci/LICENSE.txt" \ | ||
"$sdk_repo/ci/NOTICE.txt" \ | ||
"$name.pom" \ | ||
"$name-javadoc.jar" \ | ||
"$name-sources.jar" \ | ||
"$name.module" \ | ||
"$name.aar" \ | ||
) | ||
|
||
for file in "${files[@]}"; do | ||
upload_file "$remote_location_prefix/$version" "$file" | ||
done | ||
|
||
generate_maven_file "$remote_location_prefix" | ||
aws s3 cp "$version" "$remote_location_prefix/$version/" --recursive --region us-east-1 | ||
popd | ||
} | ||
|
||
release_capture_sdk | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wrong method call removed |
||
release_gradle_library "capture-timber" "$capture_timber_archive" | ||
release_gradle_library "capture-plugin" "$capture_plugin_archive" | ||
release_capture_timber |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,33 +43,15 @@ function prepare_capture_sdk() { | |
function prepare_capture_timber() { | ||
echo "+++ Preparing Android Capture Timber library artifacts for '$version' version" | ||
|
||
pushd "$(mktemp -d)" | ||
local -r out_artifacts_dir="capture-timber-out" | ||
|
||
unzip "$sdk_repo/capture-timber.zip" | ||
|
||
mkdir "$out_artifacts_dir" | ||
|
||
local -r name="capture-timber-$version" | ||
|
||
files=(\ | ||
"$name.aar" \ | ||
"$name.module" \ | ||
"$name.pom" \ | ||
"$name-javadoc.jar" \ | ||
"$name-sources.jar" \ | ||
"$sdk_repo/ci/LICENSE.txt" \ | ||
"$sdk_repo/ci/NOTICE.txt" \ | ||
) | ||
cp "$sdk_repo/capture-timber.zip" "$sdk_repo/capture-timber-$version.android.zip" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has the implication that we will now include checksum files in the GH release zips for timber/plugin which isn't ideal but I don't think anyone relies on the GH releases so seems fine until we can simplify the deployment pipeline further There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that should be fine, arguably any artifact bundle can benefit from including checksums |
||
} | ||
|
||
for file in "${files[@]}"; do | ||
filename=$(basename "$file") | ||
mv "$file" "$out_artifacts_dir/$filename" | ||
done | ||
function prepare_capture_plugin() { | ||
echo "+++ Preparing Android Capture Timber library artifacts for '$version' version" | ||
|
||
(cd "$out_artifacts_dir" && zip -r "$sdk_repo/capture-timber-$version.android.zip" ./*) | ||
popd | ||
cp "$sdk_repo/capture-plugin.zip" "$sdk_repo/capture-plugin-$version.android.zip" | ||
} | ||
|
||
prepare_capture_sdk | ||
prepare_capture_timber | ||
prepare_capture_plugin |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
id("java-gradle-plugin") | ||
} | ||
|
||
group = "io.bitdrift" | ||
|
||
dependencies { | ||
compileOnly("com.android.tools.build:gradle:7.4.0") | ||
compileOnly("org.ow2.asm:asm-commons:9.4") | ||
|
@@ -22,17 +24,51 @@ dependencies { | |
gradlePlugin { | ||
plugins { | ||
create("capturePlugin") { | ||
id = "io.bitdrift.capture.capture-plugin" | ||
id = "io.bitdrift.capture-plugin" | ||
implementationClass = "io.bitdrift.capture.CapturePlugin" | ||
} | ||
} | ||
} | ||
|
||
mavenPublishing { | ||
configureBasedOnAppliedPlugins() | ||
|
||
pom { | ||
name.set("CapturePlugin") | ||
description.set("Official Capture Gradle plugin.") | ||
url.set("https://bitdrift.io") | ||
licenses { | ||
license { | ||
name.set("BITDRIFT SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT") | ||
url.set("https://dl.bitdrift.io/sdk/android-maven/io/bitdrift/capture-plugin/${findProperty("VERSION_NAME")}/LICENSE.txt") | ||
distribution.set("repo") | ||
} | ||
license { | ||
name.set("NOTICE") | ||
url.set("https://dl.bitdrift.io/sdk/android-maven/io/bitdrift/capture-plugin/${findProperty("VERSION_NAME")}/NOTICE.txt") | ||
distribution.set("repo") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("bitdriftlabs") | ||
name.set("Bitdrift, Inc.") | ||
url.set("https://github.com/bitdriftlabs") | ||
email.set("[email protected]") | ||
} | ||
scm { | ||
connection.set("scm:git:git://github.com/bitdriftlabs/capture-sdk.git") | ||
developerConnection.set("scm:git:ssh://[email protected]:bitdriftlabs/capture-sdk.git") | ||
url.set("https://github.com/bitdriftlabs/capture-sdk") | ||
} | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
repositories { | ||
mavenLocal() | ||
maven { | ||
url = uri(layout.buildDirectory.dir("repos/releases")) | ||
} | ||
} | ||
} | ||
|
||
group = "io.bitdrift.capture.capture-plugin" | ||
version = "0.1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure the upload artifacts job already compresses all the files in a folder, not sure why we had this compression step to being with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also aren't you missing a step to run
run: ./gradlew :capture-plugin:publish
??