-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from DeployGate/supportAab
Support uploading app bundle files
- Loading branch information
Showing
34 changed files
with
1,553 additions
and
431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/groovy/com/deploygate/gradle/plugins/artifacts/AabInfo.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.deploygate.gradle.plugins.artifacts | ||
|
||
import javax.annotation.Nonnull | ||
import javax.annotation.Nullable | ||
|
||
interface AabInfo { | ||
@Nonnull | ||
String getVariantName() | ||
|
||
@Nullable | ||
File getAabFile() | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/groovy/com/deploygate/gradle/plugins/artifacts/DefaultPresetAabInfo.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.deploygate.gradle.plugins.artifacts | ||
|
||
import javax.annotation.Nonnull | ||
|
||
class DefaultPresetAabInfo extends DirectAabInfo { | ||
DefaultPresetAabInfo(@Nonnull String variantName) { | ||
super(variantName, null) | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/groovy/com/deploygate/gradle/plugins/artifacts/DirectAabInfo.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.deploygate.gradle.plugins.artifacts | ||
|
||
import com.google.common.annotations.VisibleForTesting | ||
|
||
import javax.annotation.Nonnull | ||
import javax.annotation.Nullable | ||
|
||
@VisibleForTesting | ||
class DirectAabInfo implements AabInfo { | ||
@Nonnull | ||
private final String variantName | ||
@Nullable | ||
private final File aabFile | ||
|
||
DirectAabInfo(@Nonnull String variantName, @Nullable File aabFile) { | ||
this.variantName = variantName | ||
this.aabFile = aabFile | ||
|
||
if (!variantName) { | ||
throw new IllegalArgumentException("variantName must not be null or empty") | ||
} | ||
} | ||
|
||
@Override | ||
@Nonnull | ||
String getVariantName() { | ||
return variantName | ||
} | ||
|
||
@Override | ||
@Nullable | ||
File getAabFile() { | ||
return aabFile | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/groovy/com/deploygate/gradle/plugins/tasks/UploadAabTask.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.deploygate.gradle.plugins.tasks | ||
|
||
import com.deploygate.gradle.plugins.artifacts.AabInfo | ||
import com.deploygate.gradle.plugins.dsl.NamedDeployment | ||
import com.deploygate.gradle.plugins.tasks.factory.DeployGateTaskFactory | ||
import org.gradle.api.tasks.TaskAction | ||
|
||
import javax.annotation.Nonnull | ||
|
||
class UploadAabTask extends UploadArtifactTask { | ||
static Configuration createConfiguration(@Nonnull NamedDeployment deployment, @Nonnull AabInfo aabInfo) { | ||
return new Configuration( | ||
artifactFile: deployment.sourceFile ?: aabInfo.aabFile, | ||
isSigningReady: false, | ||
isUniversalApk: false, | ||
uploadParams: createUploadParams(deployment) | ||
) | ||
} | ||
|
||
@TaskAction | ||
void doUpload() { | ||
super.doUpload() | ||
} | ||
|
||
@Override | ||
void applyTaskProfile() { | ||
setDescription("Deploy bundled $variantName to DeployGate") | ||
|
||
group = DeployGateTaskFactory.GROUP_NAME | ||
} | ||
|
||
@Override | ||
void runArtifactSpecificVerification() { | ||
} | ||
} |
Oops, something went wrong.