Skip to content
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

Modify deploy_docs script to include Android #2258

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e928970
Add android sdk
danielnugraha Jul 28, 2023
212fb46
Add new grpc implementation to run in background
danielnugraha Jul 31, 2023
19f7bda
Streaming unary call with delay
danielnugraha Aug 3, 2023
f61400a
Add release github actions and delete .idea folder
danielnugraha Aug 10, 2023
6627892
Add release github actions and delete .idea folder
danielnugraha Aug 10, 2023
d97c0c9
Merge from main
danielnugraha Aug 10, 2023
42a2785
Add documentation
danielnugraha Aug 16, 2023
05d863c
Remove unnecessary files
danielnugraha Aug 21, 2023
af2a3c2
Remove unnecessary files
danielnugraha Aug 21, 2023
0ac9557
Update android release github actions
danielnugraha Aug 21, 2023
026e26e
Update .github/workflows/android-release.yml
tanertopal Aug 21, 2023
282f69c
Update .github/workflows/android-release.yml
tanertopal Aug 21, 2023
562d9cf
Update .github/workflows/android-release.yml
danielnugraha Aug 21, 2023
543b38b
Add script for deploying docs
danielnugraha Aug 24, 2023
68399b4
Add custom assets
danielnugraha Aug 28, 2023
10286f2
Update src/kotlin/flwr/src/main/java/dev/flower/android/gRPC.kt
danielnugraha Aug 30, 2023
c8e366c
Update src/kotlin/flwr/src/main/java/dev/flower/android/gRPC.kt
danielnugraha Aug 30, 2023
cb0c60c
Update src/kotlin/flwr/src/main/java/dev/flower/android/gRPC.kt
danielnugraha Aug 30, 2023
f6430ac
Merge branch 'main' into add-android-sdk
danielnugraha Aug 30, 2023
d50b389
Move gitignore to root
danielnugraha Aug 30, 2023
a8d9938
Merge remote-tracking branch 'refs/remotes/origin/add-android-sdk' in…
danielnugraha Aug 30, 2023
07cc57b
Merge branch 'main' into add-deploy-docs
danielnugraha Aug 31, 2023
02a99a0
Merge remote-tracking branch 'origin/add-android-sdk' into add-deploy…
danielnugraha Aug 31, 2023
db723c7
Merge remote-tracking branch 'origin/add-deploy-docs' into add-deploy…
danielnugraha Aug 31, 2023
a79af26
Merge remote-tracking branch 'origin/main' into add-deploy-docs
danielnugraha Aug 31, 2023
8d106fa
Move script to separate deploy-android-docs.sh
danielnugraha Aug 31, 2023
97c99fe
Add github actions for android doc publication
danielnugraha Aug 31, 2023
56bc29a
remove filter to deploy docs
danielnugraha Aug 31, 2023
68cb17b
remove filter to deploy docs
danielnugraha Aug 31, 2023
7fa4d9b
fix cd
danielnugraha Aug 31, 2023
50dfd94
Update .github/workflows/android-release.yml
tanertopal Aug 31, 2023
d6a861a
Update .github/workflows/android-release.yml
tanertopal Aug 31, 2023
7501c68
Update dev/deploy-android-docs.sh
danielnugraha Aug 31, 2023
f1d2dda
Merge branch 'main' into add-deploy-docs
tanertopal Aug 31, 2023
7ad4d44
Merge branch 'main' into add-deploy-docs
tanertopal Aug 31, 2023
b2417bd
Merge branch 'main' into add-android-sdk
danieljanes Aug 31, 2023
05ead53
Update src/kotlin/gradle.properties
danielnugraha Aug 31, 2023
0c4b0a8
Update src/kotlin/flwr/src/main/java/dev/flower/android/gRPC.kt
danielnugraha Aug 31, 2023
9dc80d0
Rename ReRe to Rere
danielnugraha Aug 31, 2023
4d7a7f3
Merge remote-tracking branch 'origin/add-android-sdk' into add-deploy…
danielnugraha Aug 31, 2023
2129fd6
Rename to android.yml
danielnugraha Aug 31, 2023
354628c
Change to flwr
danielnugraha Aug 31, 2023
27355cb
Merge branch 'main' into add-deploy-docs
danielnugraha Aug 31, 2023
faf892d
Update .github/workflows/android.yml
tanertopal Aug 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Android Client Publish

on:
pull_request
Copy link
Member

@tanertopal tanertopal Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
on:
pull_request
on:
push:
branches:
- main

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we always wants to deploy the docs on pull request?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. We don't. I adjusted the suggestion.


jobs:
deploy_docs:
runs-on: ubuntu-latest
name: Deploy Android docs
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 11
- name: Build and deploy docs
env:
AWS_DEFAULT_REGION: ${{ secrets. AWS_DEFAULT_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets. AWS_SECRET_ACCESS_KEY }}
run: ./dev/deploy-android-docs.sh

tanertopal marked this conversation as resolved.
Show resolved Hide resolved
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,21 @@ poetry.lock

# iOS
xcuserdata/

# Android
.gradle
.idea
local.properties
app/src/main/assets
/build
*.iml
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/captures
.externalNativeBuild
.cxx
28 changes: 28 additions & 0 deletions dev/deploy-android-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# Copyright 2020 Adap GmbH. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

set -e
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../

ROOT=`pwd`

# Build and deploy Flower Android docs
cd $ROOT
cd src/kotlin
./gradlew dokkaHtml
cd flwr/build/dokka/html
aws s3 sync --delete --exclude ".*" --exclude "v/*" --acl public-read --cache-control "no-cache" ./ s3://flower.dev/docs/android
danielnugraha marked this conversation as resolved.
Show resolved Hide resolved
1 change: 0 additions & 1 deletion examples/android/client/app/.gitignore

This file was deleted.

18 changes: 18 additions & 0 deletions src/kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
// Not 8.0.2 because on macOS `Could not find protoc-3.11.0-osx-aarch_64.exe (com.google.protobuf:protoc:3.11.0)`
classpath("com.android.tools.build:gradle:7.4.2")
// Not 0.9.2 because of https:/grpc/grpc-kotlin/issues/380
classpath("com.google.protobuf:protobuf-gradle-plugin:0.9.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")

classpath("com.vanniktech:gradle-maven-publish-plugin:0.25.3") // NEW

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
107 changes: 107 additions & 0 deletions src/kotlin/flwr/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.DokkaBaseConfiguration

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("com.google.protobuf")
id("maven-publish")
id("com.vanniktech.maven.publish")
id("org.jetbrains.dokka") version "1.8.20"
}

buildscript {
dependencies {
classpath("org.jetbrains.dokka:dokka-base:1.8.20")
}
}

android {
namespace = "dev.flower"
compileSdk = 33

defaultConfig {
aarMetadata {
minCompileSdk = 28
}
minSdk = 28
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.1"
}
packagingOptions {
resources {
excludes.add("/META-INF/{AL2.0,LGPL2.1}")
}
}
}

val grpcVersion = "1.56.1"

protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.23.4"
}
plugins {
create("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion"
}
}
generateProtoTasks {
all().forEach { task ->
task.builtins {
create("java") {
option("lite")
}
}
task.plugins {
create("grpc") {
option("lite")
}
}
}
}
}

tasks.dokkaHtml {
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
customStyleSheets = listOf(file("res/style.css"))
customAssets = listOf(file("res/logo-icon.svg"))
footerMessage = "(c) 2023 Flower Labs GmbH"
}
}

dependencies {
implementation("androidx.core:core-ktx:1.10.1")
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
implementation("io.grpc:grpc-okhttp:$grpcVersion")
implementation("io.grpc:grpc-protobuf-lite:$grpcVersion")
implementation("io.grpc:grpc-stub:$grpcVersion")
implementation("javax.annotation:javax.annotation-api:1.3.2")

protobuf(files("../../proto"))
dokkaPlugin("org.jetbrains.dokka:android-documentation-plugin:1.8.20")

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}
21 changes: 21 additions & 0 deletions src/kotlin/flwr/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
14 changes: 14 additions & 0 deletions src/kotlin/flwr/res/logo-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading