Skip to content

Commit

Permalink
Merge pull request #24 from cyface-de/release-2.0.0_DAT-1226
Browse files Browse the repository at this point in the history
Release 2.0.0 dat 1226
  • Loading branch information
hb0 authored Jun 6, 2022
2 parents 46327a5 + 21da257 commit ca02399
Show file tree
Hide file tree
Showing 9 changed files with 994 additions and 184 deletions.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

33 changes: 23 additions & 10 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
= Cyface Protocol Buffer Messages
= Cyface Protobuf Messages

This repository defines the Cyface Models as schemas such as Protocol Buffer Schemas.
This allows to de-/serialize the Cyface Binary Data from in different programming languages.

For more details on Protocol Buffers (short: Protobuf) check out it's link:https://developers.google.com/protocol-buffers[documentation].
For more details on Protocol Buffers (short: Protobuf) check out its link:https://developers.google.com/protocol-buffers[documentation].


== Message Format Definitions

This is a collection of `.proto` files describe the data structure of the Cyface Models.

- This allows Protobuf to automatically de-/encode the the data from/to binary files.
- This allows Protobuf to automatically de-/encode the data from/to binary files.
- Supports later extensions of the format with backward-compatibility
- Following the link:https://developers.google.com/protocol-buffers/docs/style[Style Guide]

Expand All @@ -30,7 +30,7 @@ Reminders from the documentation which need to be considered for future updates:

- link:https://developers.google.com/protocol-buffers/docs/proto3#default[Default values]

- Scalar message fields, once parsed, cannot tell if a field was not set or set the the default value afterwards.
- Scalar message fields, once parsed, cannot tell if a field was not set or set the default value afterwards.
- Default values are not serialized on the wire.
- Keep this in mind when defining e.g. booleans, make sure you want that "default" `false` behavior on.

Expand All @@ -47,7 +47,7 @@ Other message types:

Generates serializer, deserializer, etc. in a chosen language, e.g. `.java` files for Java.

Java classes can be compiled with link:https://developers.google.com/protocol-buffers/docs/javatutorial#compiling-your-protocol-buffers[protoc] (Protocol Buffers `v3.17.0`):
Java classes can be compiled with link:https://developers.google.com/protocol-buffers/docs/javatutorial#compiling-your-protocol-buffers[protoc] (Protocol Buffers, version: see `protobufVersion` in `build.gradle`):

protoc --java_out=./src/main/java/ src/main/protos/de/cyface/protos/model/measurement.proto

Expand All @@ -62,20 +62,33 @@ However, the pre-compiled `JARs` are also published to the link:https://github.c

Or you can download the `proto` link:protoc --java_out=./src/main/java/ src/main/protos/de/cyface/protos/model/measurement.proto[files] from this repository and then generate the classes using the link:https://github.com/google/protobuf-gradle-plugin[Gradle Plugin]. This is done in the link:https://github.com/cyface-de/android-backend[Cyface Android SDK] - check it out if you need an example.

The serializers encode the data in an efficient way, the decision process is documented link:https://cyface.atlassian.net/wiki/spaces/IM/pages/1535148033/Datenformat+bertragungsprotokoll+2021[internally].
The serializers encode the data in an efficient way, the decision process is documented link:https://cyface.atlassian.net/wiki/spaces/IM/pages/1535148033/Datenformat+bertragungsprotokoll+API+V3[internally].


== Using the generated Code

____
Protocol Buffers and Object Oriented Design Protocol buffer classes are basically dumb data holders (like structs in C); they don't make good first class citizens in an object model. If you want to add richer behavior to a generated class, the best way to do this is to wrap the generated protocol buffer class in an application-specific class.
Protocol Buffers and Object-Oriented Design Protocol buffer classes are basically dumb data holders (like structs in C); they don't make good first class citizens in an object model. If you want to add richer behavior to a generated class, the best way to do this is to wrap the generated protocol buffer class in an application-specific class.
____
link:https://developers.google.com/protocol-buffers/docs/javatutorial#builders[Source]


[#_licensing]
== Licensing

Copyright (C) 2021 Cyface GmbH - All Rights Reserved
Unauthorized copying of this file, via any medium is strictly prohibited
Proprietary and confidential
Copyright 2021-2022 Cyface GmbH

This file is part of the Cyface Protobuf Messages.

The Cyface Protobuf Messages is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

The Cyface Protobuf Messages is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with the Cyface Protobuf Messages. If not, see http://www.gnu.org/licenses/.
27 changes: 13 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
/*
* Copyright 2021 Cyface GmbH
* Copyright 2021-2022 Cyface GmbH
*
* This file is part of the Cyface Protocol Buffer Messages.
* This file is part of the Cyface Protobuf Messages.
*
* The Cyface Protocol Buffer Messages is free software: you can redistribute it and/or modify
* The Cyface Protobuf Messages is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Cyface Protocol Buffer Messages is distributed in the hope that it will be useful,
* The Cyface Protobuf Messages is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the Cyface Protocol Buffer Messages. If not, see <http://www.gnu.org/licenses/>.
* along with the Cyface Protobuf Messages. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* The root build gradle file.
*
* @author Armin Schnabel
* @version 1.0.0
* @version 1.0.1
* @since 1.0.0
*/
buildscript {
Expand All @@ -35,12 +35,12 @@ plugins {
id 'idea'
id 'maven-publish'
//noinspection SpellCheckingInspection
id 'com.github.johnrengelman.shadow' version '6.1.0'
id 'com.google.protobuf' version '0.8.16'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'com.google.protobuf' version '0.8.18'
}

group = 'de.cyface'
version = '1.0.0'
version = '2.0.0'

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
Expand All @@ -51,14 +51,13 @@ tasks.withType(JavaCompile) {

ext {
commonsLangVersion = '3.12.0'
gradleWrapperVersion = '6.8.3'
protobufVersion = '3.17.0'
gradleWrapperVersion = '7.4.2'
protobufVersion = '3.21.1'

// Versions of testing dependencies
junitVersion = '5.7.0'
mockitoVersion = '3.3.3'
junitVersion = '5.8.2'
mockitoVersion = '4.6.0'
hamcrestVersion = '2.2'
flapdoodleVersion = '3.0.0'
}

wrapper {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit ca02399

Please sign in to comment.