]> granicus.if.org Git - esp-idf/commitdiff
examples: aws_iot: fix cmake build issue which used to pick dummy certificates
authorMahavir Jain <mahavir@espressif.com>
Fri, 25 Jan 2019 10:07:44 +0000 (15:37 +0530)
committerMahavir Jain <mahavir@espressif.com>
Mon, 28 Jan 2019 05:15:34 +0000 (10:45 +0530)
For CI build now `sdkconfig.ci` file is used which builds examples assuming certificate
stored on SDCard.

examples/protocols/aws_iot/subscribe_publish/main/CMakeLists.txt
examples/protocols/aws_iot/subscribe_publish/main/component.mk
examples/protocols/aws_iot/subscribe_publish/sdkconfig.ci [new file with mode: 0644]
examples/protocols/aws_iot/thing_shadow/main/CMakeLists.txt
examples/protocols/aws_iot/thing_shadow/main/component.mk
examples/protocols/aws_iot/thing_shadow/sdkconfig.ci [new file with mode: 0644]

index 67b51b9f5461e37f6eb763c16df61c10063b1d4d..807ad6ea0f6ac2a2f1b599e02784b6d5c5953abc 100644 (file)
@@ -6,23 +6,6 @@ register_component()
 
 if(CONFIG_EXAMPLE_EMBEDDED_CERTS)
 target_add_binary_data(${COMPONENT_TARGET} "certs/aws-root-ca.pem" TEXT)
-
-if(NOT IDF_CI_BUILD)
-    add_custom_command(OUTPUT certs/certificate.pem.crt certs/private.pem.key
-                        COMMAND echo "Dummy certificate data for continuous integration" >
-                                certs/certificate.pem.crt
-                        COMMAND echo "Dummy certificate data for continuous integration" >
-                                certs/private.pem.key
-                        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-                        VERBATIM)
-    add_custom_target(example_certificates DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt ${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key)
-    
-    add_dependencies(${COMPONENT_TARGET} example_certificates)
-    
-    target_add_binary_data(${COMPONENT_TARGET} "${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt" TEXT)
-    target_add_binary_data(${COMPONENT_TARGET} "${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key" TEXT)
-else()
-    target_add_binary_data(${COMPONENT_TARGET} "certs/certificate.pem.crt" TEXT)
-    target_add_binary_data(${COMPONENT_TARGET} "certs/private.pem.key" TEXT) 
+target_add_binary_data(${COMPONENT_TARGET} "certs/certificate.pem.crt" TEXT)
+target_add_binary_data(${COMPONENT_TARGET} "certs/private.pem.key" TEXT)
 endif()
-endif()
\ No newline at end of file
index bc11b6393322172f089b9bb9416089e02c48f743..401de47a5d58369d5faedd5c93c9bc82a22523a6 100644 (file)
@@ -7,16 +7,8 @@ ifdef CONFIG_EXAMPLE_EMBEDDED_CERTS
 # from AWS, see README for details.
 COMPONENT_EMBED_TXTFILES := certs/aws-root-ca.pem certs/certificate.pem.crt certs/private.pem.key
 
-ifndef IDF_CI_BUILD
 # Print an error if the certificate/key files are missing
 $(COMPONENT_PATH)/certs/certificate.pem.crt $(COMPONENT_PATH)/certs/private.pem.key:
        @echo "Missing PEM file $@. This file identifies the ESP32 to AWS for the example, see README for details."
        exit 1
-else  # IDF_CI_BUILD
-# this case is for the internal Continuous Integration build which
-# compiles all examples. Add some dummy certs so the example can
-# compile (even though it won't work)
-$(COMPONENT_PATH)/certs/certificate.pem.crt $(COMPONENT_PATH)/certs/private.pem.key:
-       echo "Dummy certificate data for continuous integration" > $@
-endif
 endif
diff --git a/examples/protocols/aws_iot/subscribe_publish/sdkconfig.ci b/examples/protocols/aws_iot/subscribe_publish/sdkconfig.ci
new file mode 100644 (file)
index 0000000..b59dfb8
--- /dev/null
@@ -0,0 +1,2 @@
+# For CI build example assuming certificates stored on sdcard
+CONFIG_EXAMPLE_SDCARD_CERTS=y
index 0fcad6405c90d86952e31081dc3f15540f02a1e3..f97a426c6d8303bfbb879949a8640bda75ac02f1 100644 (file)
@@ -6,23 +6,6 @@ register_component()
 
 if(CONFIG_EXAMPLE_EMBEDDED_CERTS)
 target_add_binary_data(${COMPONENT_TARGET} "certs/aws-root-ca.pem" TEXT)
-
-if(NOT IDF_CI_BUILD)
-    add_custom_command(OUTPUT certs/certificate.pem.crt certs/private.pem.key
-                        COMMAND echo "Dummy certificate data for continuous integration" >
-                                certs/certificate.pem.crt
-                        COMMAND echo "Dummy certificate data for continuous integration" >
-                                certs/private.pem.key
-                        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-                        VERBATIM)
-    add_custom_target(example_certificates DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt ${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key)
-    
-    add_dependencies(${COMPONENT_TARGET} example_certificates)
-    
-    target_add_binary_data(${COMPONENT_TARGET} "${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt" TEXT)
-    target_add_binary_data(${COMPONENT_TARGET} "${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key" TEXT)
-else()
-    target_add_binary_data(${COMPONENT_TARGET} "certs/certificate.pem.crt" TEXT)
-    target_add_binary_data(${COMPONENT_TARGET} "certs/private.pem.key" TEXT) 
+target_add_binary_data(${COMPONENT_TARGET} "certs/certificate.pem.crt" TEXT)
+target_add_binary_data(${COMPONENT_TARGET} "certs/private.pem.key" TEXT)
 endif()
-endif()
\ No newline at end of file
index bc11b6393322172f089b9bb9416089e02c48f743..401de47a5d58369d5faedd5c93c9bc82a22523a6 100644 (file)
@@ -7,16 +7,8 @@ ifdef CONFIG_EXAMPLE_EMBEDDED_CERTS
 # from AWS, see README for details.
 COMPONENT_EMBED_TXTFILES := certs/aws-root-ca.pem certs/certificate.pem.crt certs/private.pem.key
 
-ifndef IDF_CI_BUILD
 # Print an error if the certificate/key files are missing
 $(COMPONENT_PATH)/certs/certificate.pem.crt $(COMPONENT_PATH)/certs/private.pem.key:
        @echo "Missing PEM file $@. This file identifies the ESP32 to AWS for the example, see README for details."
        exit 1
-else  # IDF_CI_BUILD
-# this case is for the internal Continuous Integration build which
-# compiles all examples. Add some dummy certs so the example can
-# compile (even though it won't work)
-$(COMPONENT_PATH)/certs/certificate.pem.crt $(COMPONENT_PATH)/certs/private.pem.key:
-       echo "Dummy certificate data for continuous integration" > $@
-endif
 endif
diff --git a/examples/protocols/aws_iot/thing_shadow/sdkconfig.ci b/examples/protocols/aws_iot/thing_shadow/sdkconfig.ci
new file mode 100644 (file)
index 0000000..b59dfb8
--- /dev/null
@@ -0,0 +1,2 @@
+# For CI build example assuming certificates stored on sdcard
+CONFIG_EXAMPLE_SDCARD_CERTS=y