Skip to content

Commit

Permalink
Add protobuf object: PITA
Browse files Browse the repository at this point in the history
  • Loading branch information
espen-j committed Aug 11, 2022
1 parent 15ea262 commit 951dac3
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
31 changes: 30 additions & 1 deletion app/build.gradle
@@ -1,6 +1,16 @@
buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.19'
}
}

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id "com.google.protobuf" version "0.8.19"
}

android {
Expand Down Expand Up @@ -46,7 +56,6 @@ android {
}

dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material3:material3:1.0.0-alpha15"
Expand All @@ -60,4 +69,24 @@ dependencies {
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
}

protobuf {
protoc {
// You still need protoc like in the non-Android case
artifact = 'com.google.protobuf:protoc:3.21.5'
}
generateProtoTasks {
all().each { task ->
task.plugins {
java {
option "lite"
}
}
}
}
}

dependencies {
implementation 'com.google.protobuf:protobuf-javalite:3.21.5'
}
10 changes: 10 additions & 0 deletions app/src/main/proto/test.proto
@@ -0,0 +1,10 @@
syntax = "proto3";

option java_package = "io.zeitmaschine.zimzync";
option java_multiple_files = true;

message Test {
string url = 1;
string key = 2;
string secret = 3;
}

0 comments on commit 951dac3

Please sign in to comment.