Skip to content

Commit

Permalink
Merge branch 'init-appsize-branch'
Browse files Browse the repository at this point in the history
  • Loading branch information
vanminh-grabtaxi committed Nov 23, 2024
2 parents d08e00b + b0c7c5b commit 591a3e9
Show file tree
Hide file tree
Showing 428 changed files with 32,328 additions and 57 deletions.
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Proposed Changes

## Testing

<!--- Please describe how you tested your changes. -->

## Issues Fixed
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: App Sizer CI

on:
push:
branches: [ main, master ]
pull_request:
workflow_dispatch:
inputs:
release:
description: 'Trigger a release build'
required: false
default: ''

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
TERM: dumb

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install JDK 17
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
- name: Build
run: ./gradlew assemble
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: |
gradle-plugin/build/libs/*.jar
clt/build/libs/*.jar
retention-days: 7

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install JDK 17
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
- name: Run tests
run: ./gradlew test

build-sample-app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install JDK 17
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
- name: Build sample app
run: |
cd ./sample
./gradlew app:appSizeAnalysisProRelease --stacktrace -Dorg.gradle.debug=false --no-daemon
69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release App Sizer

on:
release:
types: [created]

env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
TERM: dumb

jobs:
release-cli:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write

steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "11"

- name: Get version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Build CLI JAR
run: ./gradlew clt:shadowJar

- name: Rename and prepare assets
run: |
cd ./clt/build/libs
mv clt-all.jar app-sizer-cli-${{ env.VERSION }}.jar
sha256sum app-sizer-cli-${{ env.VERSION }}.jar > app-sizer-cli-${{ env.VERSION }}.jar.sha256
- name: Upload CLI JAR
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./clt/build/libs/app-sizer-cli-${{ env.VERSION }}.jar
asset_name: app-sizer-cli-${{ env.VERSION }}.jar
asset_content_type: application/java-archive

- name: Upload checksum
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./clt/build/libs/app-sizer-cli-${{ env.VERSION }}.jar.sha256
asset_name: app-sizer-cli-${{ env.VERSION }}.jar.sha256
asset_content_type: text/plain

release-plugin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "11"
- name: Publish plugin to Artifactory
run: ./gradlew artifactoryPublish
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*.iml
.gradle/
local.properties
.idea/*
!.idea/copyright
sample/.idea/*
.DS_Store
/build/
build/
/captures


# Windows thumbnail db
# Idea non-crucial project fileS
*.iws
.java-version
39 changes: 39 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
default:
image: gitlab.myteksi.net:4567/mobile/platform/mobile-tooling/base-android:34.0.0
tags:
- 2xlarge
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"

stages:
- build
- test
- publish

build:
stage: build
script:
- ./gradlew assemble
artifacts:
paths:
- gradle-plugin/build/libs/*.jar
- clt/build/libs/*.jar
expire_in: 1 week

test:
stage: test
script:
- ./gradlew test

build_sample_app:
stage: test
script:
- cd ./sample
- ./gradlew app:appSizeAnalysisProRelease --stacktrace -Dorg.gradle.debug=false --no-daemon

publish_artifact:
stage: build
rules:
- if: $RELEASE == "publish"
script:
- ./gradlew artifactoryPublish
6 changes: 6 additions & 0 deletions .idea/copyright/MIT_License.xml.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
MIT License


Copyright 2024 Grabtaxi Holdings Pte Ltd (GRAB), All rights reserved.


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
Loading

0 comments on commit 591a3e9

Please sign in to comment.