From c218dec1f2730ceb9b62138402374f7014b5a3cf Mon Sep 17 00:00:00 2001 From: reyniersbram <55666730+reyniersbram@users.noreply.github.com> Date: Sat, 25 Mar 2023 16:33:19 +0100 Subject: [PATCH] add protobuf --- .idea/inspectionProfiles/Project_Default.xml | 41 ++++++++++++++++++++ app/build.gradle | 26 +++++++++++++ app/src/main/proto/saves.proto | 8 ++++ 3 files changed, 75 insertions(+) create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 app/src/main/proto/saves.proto diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..44ca2d9 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,41 @@ + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index e1e92d2..238a061 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,6 +5,9 @@ plugins { // Hilt id 'kotlin-kapt' id 'com.google.dagger.hilt.android' + + // Protobuf + id 'com.google.protobuf' version '0.8.17' } android { @@ -71,9 +74,32 @@ dependencies { // Hilt implementation 'com.google.dagger:hilt-android:2.44' kapt 'com.google.dagger:hilt-compiler:2.44' + + // Proto DataStore + implementation 'androidx.datastore:datastore:1.0.0' + implementation 'com.google.protobuf:protobuf-javalite:3.18.0' } // Allow references to generate code kapt { correctErrorTypes true +} + +protobuf { + protoc { + artifact = 'com.google.protobuf:protoc:3.21.7' + } + + // Generates the java Protobuf-lite code for the Protobufs in this project. See + // https://github.com/google/protobuf-gradle-plugin#customizing-protobuf-compilation + // for more information + generateProtoTasks { + all().each { task -> + task.builtins { + java { + option 'lite' + } + } + } + } } \ No newline at end of file diff --git a/app/src/main/proto/saves.proto b/app/src/main/proto/saves.proto new file mode 100644 index 0000000..52da46d --- /dev/null +++ b/app/src/main/proto/saves.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; + +option java_package = "be.ugent.sel.studeez"; +option java_multiple_files = true; + +message Saves { + map ids = 1; +} \ No newline at end of file