瀏覽代碼

Merge branch 'develop' into feature/PROTO-33-improve-sonar-score-and-coverag

Bart Hertog 5 年之前
父節點
當前提交
82cb3653d4

+ 2 - 3
bitbucket-pipelines-dependencies.sh

@@ -61,7 +61,6 @@ export PATH="$PATH:$PWD/sonar-scanner/bin"
 if [ -d "$PWD/venv" ]; then
   echo "found python virtualenv in cache"
 else
-  python3 -m venv venv
+  ./setup.sh
 fi
-source venv/bin/activate
-pip install -r requirements.txt
+

+ 1 - 1
bitbucket-pipelines.yml

@@ -26,7 +26,7 @@ pipelines:
           
           - cd -
           - export SONAR_SCANNER_OPTS="-Xmx1024m"
-          - sonar-scanner -Dproject.settings=sonar-project.properties
+          - sonar-scanner -Dproject.settings=sonar-project.properties -Dsonar.login=$SONAR_LOGIN
                  
 definitions:
   caches:

+ 39 - 0
setup.sh

@@ -0,0 +1,39 @@
+#! /bin/bash
+
+#
+# Copyright (C) 2020 Embedded AMS B.V. - All Rights Reserved
+#
+# This file is part of Embedded Proto.
+#
+# Embedded Proto is open source 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, version 3 of the license.
+#
+# Embedded Proto  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 Embedded Proto. If not, see <https://www.gnu.org/licenses/>.
+#
+# For commercial and closed source application please visit:
+# <https://EmbeddedProto.com/license/>.
+#
+# Embedded AMS B.V.
+# Info:
+#   info at EmbeddedProto dot com
+#
+# Postal address:
+#   Johan Huizingalaan 763a
+#   1066 VH, Amsterdam
+#   the Netherlands
+#
+
+# This script will setup the environment to generate source code in your project.
+
+# Setup the virtual envirounment for Python packages
+python3 -m venv venv
+source ./venv/bin/activate
+pip install -r requirements.txt
+

+ 0 - 2
sonar-project.properties

@@ -36,8 +36,6 @@ sonar.host.url=https://sonarcloud.io
 sonar.projectName=EmbeddedProto
 sonar.projectVersion=1.0
 sonar.organization=embeddedams
-# sonar authentication key
-sonar.login=492dba2b1a7da82eaea36308ce177f6033626bca
 
 # sonar-bitbucket-plugin
 sonar.bitbucket.minSeverity=INFO

+ 2 - 0
src/FieldStringBytes.h

@@ -34,9 +34,11 @@
 #include "Fields.h"
 #include "Errors.h"
 
+#include <cstdint>
 #include <string.h>
 #include <type_traits>
 
+
 namespace EmbeddedProto
 {
 

+ 3 - 0
src/Fields.h

@@ -36,6 +36,9 @@
 #include "WriteBufferInterface.h"
 #include "ReadBufferInterface.h"
 
+#include <cstdint>
+
+
 namespace EmbeddedProto 
 {
 

+ 3 - 2
src/MessageInterface.h

@@ -31,12 +31,13 @@
 #ifndef _MESSAGE_INTERFACE_H_
 #define _MESSAGE_INTERFACE_H_
 
-#include <cstdint>
-
 #include "WireFormatter.h"
 #include "Fields.h"
 #include "Errors.h"
 
+#include <cstdint>
+
+
 namespace EmbeddedProto 
 {
 

+ 3 - 1
src/MessageSizeCalculator.h

@@ -31,9 +31,11 @@
 #ifndef _MESSAGE_SIZE_CALCULATOR_H_
 #define _MESSAGE_SIZE_CALCULATOR_H_
 
+#include "WriteBufferInterface.h"
+
+#include <cstdint>
 #include <limits> 
 
-#include "WriteBufferInterface.h"
 
 namespace EmbeddedProto 
 {

+ 3 - 0
src/ReadBufferInterface.h

@@ -31,6 +31,9 @@
 #ifndef _READ_BUFFER_INTERFACE_H_
 #define _READ_BUFFER_INTERFACE_H_
 
+#include <cstdint>
+
+
 namespace EmbeddedProto 
 {
   //! The pure virtual definition of a message buffer to read from.

+ 2 - 1
src/ReadBufferSection.h

@@ -31,9 +31,10 @@
 #ifndef _READ_BUFFER_SECTION_H_
 #define _READ_BUFFER_SECTION_H_
 
+#include "ReadBufferInterface.h"
+
 #include <cstdint>
 
-#include "ReadBufferInterface.h"
 
 namespace EmbeddedProto 
 {

+ 4 - 2
src/RepeatedField.h

@@ -31,14 +31,16 @@
 #ifndef _REPEATED_FIELD_H_
 #define _REPEATED_FIELD_H_
 
-#include <type_traits>
-
 #include "Fields.h"
 #include "MessageInterface.h"
 #include "MessageSizeCalculator.h"
 #include "ReadBufferSection.h" 
 #include "Errors.h"
 
+#include <cstdint>
+#include <type_traits>
+
+
 namespace EmbeddedProto
 {
 

+ 3 - 1
src/RepeatedFieldFixedSize.h

@@ -34,8 +34,10 @@
 #include "RepeatedField.h"
 #include "Errors.h"
 
+#include <cstdint>
 #include <cstring>
-#include <algorithm>    // std::min
+#include <algorithm>
+
 
 namespace EmbeddedProto
 {

+ 4 - 3
src/WireFormatter.h

@@ -31,14 +31,15 @@
 #ifndef _WIRE_FORMATTER_H_
 #define _WIRE_FORMATTER_H_
 
+#include "WriteBufferInterface.h"
+#include "ReadBufferInterface.h"
+#include "Errors.h"
+
 #include <cstdint>
 #include <math.h> 
 #include <type_traits>
 #include <limits>
 
-#include "WriteBufferInterface.h"
-#include "ReadBufferInterface.h"
-#include "Errors.h"
 
 namespace EmbeddedProto 
 {

+ 3 - 0
src/WriteBufferInterface.h

@@ -31,6 +31,9 @@
 #ifndef _WRITE_BUFFER_INTERFACE_H_
 #define _WRITE_BUFFER_INTERFACE_H_
 
+#include <cstdint>
+
+
 namespace EmbeddedProto 
 {
   //! The pure virtual definition of a message buffer used for writing .