adafruit / Adafruit_INA219

INA219 Current Sensor
Other
204 stars 145 forks source link

library.properties carries too much dependencies #34

Closed XNinety9 closed 4 years ago

XNinety9 commented 4 years ago

Hi.

When used with platformIO, this library fetches many useless dependencies (Adafruit NeoPixel, Adafruit GFX Library, Adafruit SSD1306):

Dependency Graph
|-- <Adafruit BMP085 Library> 1.0.1
|   |-- <Wire> 1.0
|-- <Adafruit INA219> 1.0.7
|   |-- <Adafruit NeoPixel> 1.3.5
|   |-- <Adafruit GFX Library> 1.7.5
|   |   |-- <Adafruit ILI9341> 1.5.4
|   |   |   |-- <Adafruit STMPE610> 1.1.0
|   |   |   |   |-- <Wire> 1.0
|   |   |   |-- <Adafruit TouchScreen> 1.0.4
|   |-- <Adafruit SSD1306> 2.2.1
|   |   |-- <Adafruit GFX Library> 1.7.5
|   |   |   |-- <Adafruit ILI9341> 1.5.4
|   |   |   |   |-- <Adafruit STMPE610> 1.1.0
|   |   |   |   |   |-- <Wire> 1.0
|   |   |   |   |-- <Adafruit TouchScreen> 1.0.4
|   |   |-- <Wire> 1.0
|   |-- <Wire> 1.0

And thus provokes undesired errors at compile time:

Building in release mode
Compiling .pio/build/esp12e/src/main.cpp.o
Compiling .pio/build/esp12e/lib794/Adafruit STMPE610_ID377/Adafruit_STMPE610.cpp.o
Compiling .pio/build/esp12e/libd92/Adafruit TouchScreen_ID5430/TouchScreen.cpp.o
Compiling .pio/build/esp12e/lib223/Adafruit ILI9341_ID571/Adafruit_ILI9341.cpp.o
Compiling .pio/build/esp12e/libea9/Adafruit GFX Library_ID13/Adafruit_SPITFT.cpp.o
.pio/libdeps/esp12e/Adafruit STMPE610_ID377/Adafruit_STMPE610.cpp:31:17: fatal error: SPI.h: No such file or directory

*************************************************************
* Looking for SPI.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:SPI.h"
* Web  > https://platformio.org/lib/search?query=header:SPI.h
*
*************************************************************

 #include <SPI.h>
                 ^
compilation terminated.
Compiling .pio/build/esp12e/lib483/Adafruit SSD1306_ID135/Adafruit_SSD1306.cpp.o
In file included from .pio/libdeps/esp12e/Adafruit ILI9341_ID571/Adafruit_ILI9341.h:42:0,
                 from .pio/libdeps/esp12e/Adafruit ILI9341_ID571/Adafruit_ILI9341.cpp:49:
.pio/libdeps/esp12e/Adafruit GFX Library_ID13/Adafruit_SPITFT.h:26:17: fatal error: SPI.h: No such file or directory

*************************************************************
* Looking for SPI.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:SPI.h"
* Web  > https://platformio.org/lib/search?query=header:SPI.h
*
*************************************************************

 #include <SPI.h>
                 ^
compilation terminated.
Archiving .pio/build/esp12e/libb2f/libAdafruit INA219_ID160.a
*** [.pio/build/esp12e/lib794/Adafruit STMPE610_ID377/Adafruit_STMPE610.cpp.o] Error 1
Indexing .pio/build/esp12e/libb2f/libAdafruit INA219_ID160.a
*** [.pio/build/esp12e/lib223/Adafruit ILI9341_ID571/Adafruit_ILI9341.cpp.o] Error 1
Archiving .pio/build/esp12e/lib1ad/libPubSubClient_ID89.a
In file included from .pio/libdeps/esp12e/Adafruit GFX Library_ID13/Adafruit_SPITFT.cpp:36:0:
.pio/libdeps/esp12e/Adafruit GFX Library_ID13/Adafruit_SPITFT.h:26:17: fatal error: SPI.h: No such file or directory

*************************************************************
* Looking for SPI.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:SPI.h"
* Web  > https://platformio.org/lib/search?query=header:SPI.h
*
*************************************************************

 #include <SPI.h>
                 ^
compilation terminated.
*** [.pio/build/esp12e/libea9/Adafruit GFX Library_ID13/Adafruit_SPITFT.cpp.o] Error 1
Indexing .pio/build/esp12e/lib1ad/libPubSubClient_ID89.a
In file included from .pio/libdeps/esp12e/Adafruit SSD1306_ID135/Adafruit_SSD1306.cpp:52:0:
.pio/libdeps/esp12e/Adafruit SSD1306_ID135/Adafruit_SSD1306.h:40:17: fatal error: SPI.h: No such file or directory

*************************************************************
* Looking for SPI.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:SPI.h"
* Web  > https://platformio.org/lib/search?query=header:SPI.h
*
*************************************************************

 #include <SPI.h>
                 ^
compilation terminated.
*** [.pio/build/esp12e/lib483/Adafruit SSD1306_ID135/Adafruit_SSD1306.cpp.o] Error 1
In file included from .pio/libdeps/esp12e/Adafruit TouchScreen_ID5430/TouchScreen.cpp:14:0:
.pio/libdeps/esp12e/Adafruit TouchScreen_ID5430/TouchScreen.h:51:12: error: 'RwReg' does not name a type
   volatile RwReg *xp_port, *yp_port, *xm_port, *ym_port;
            ^
.pio/libdeps/esp12e/Adafruit TouchScreen_ID5430/TouchScreen.h:52:3: error: 'RwReg' does not name a type
   RwReg xp_pin, xm_pin, yp_pin, ym_pin;
   ^
*** [.pio/build/esp12e/libd92/Adafruit TouchScreen_ID5430/TouchScreen.cpp.o] Error 1
============================================================================== [FAILED] Took 2.26 seconds ==============================================================================

Environment    Status    Duration
-------------  --------  ------------
esp12e         FAILED    00:00:02.263
esp01          IGNORED
esp32dev       IGNORED
======================================================================== 1 failed, 0 succeeded in 00:00:02.263 ========================================================================
The terminal process terminated with exit code: 1
siddacious commented 4 years ago

The dependencies are not useless, they're required for the examples. If the dependency resolution is an issue you should file an issue with PlatformIO