diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index de1ae55..68a975d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -7,9 +7,17 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ python3-pip \ git \ curl \ + fish \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +RUN mkdir -p /home/vscode/.local/share/CMakeTools \ +&& chown -R vscode:vscode /home/vscode/.local/share/CMakeTools + +RUN mkdir -p /home/vscode/.ssh \ + && chown vscode:vscode /home/vscode/.ssh \ + && chmod 700 /home/vscode/.ssh + # Install arduino-cli RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh @@ -22,16 +30,16 @@ ENV PATH="/usr/local/bin:${PATH}" # Create workspace directory WORKDIR /workspace -# Copy arduino-cli configuration +# Copy arduino-cli configuration (customise to your actual path) COPY arduino-cli.yaml /root/.arduino15/arduino-cli.yaml # Install build essentials -RUN apt-get update && apt-get install -y build-essential +RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/* -# Install Arduino cores for ESP8266 and ESP32 +# (Optional) Install Arduino cores for ESP8266 and ESP32 if needed RUN arduino-cli core install esp8266:esp8266 esp32:esp32 -# Install only required dependencies for DallasTemperature library +# Install only required dependencies for DallasTemperature library and others RUN arduino-cli lib install \ "OneWire" \ "ArduinoUnit" # For testing @@ -43,13 +51,27 @@ RUN arduino-cli lib list COPY update-libraries.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/update-libraries.sh -# Add aliases for build operations +# Add aliases for build operations (for Bash) RUN echo 'alias arduino-build="./build.sh build"' >> /home/vscode/.bashrc && \ echo 'alias arduino-test="./build.sh test"' >> /home/vscode/.bashrc && \ echo 'alias arduino-build-test="./build.sh all"' >> /home/vscode/.bashrc -# Add welcome message to .bashrc +# Add a welcome message to .bashrc RUN echo '\n# Welcome to the dev container! Here are some useful aliases:' >> /home/vscode/.bashrc && \ echo 'echo " - arduino-build: Build the project"' >> /home/vscode/.bashrc && \ echo 'echo " - arduino-test: Run tests for the project"' >> /home/vscode/.bashrc && \ echo 'echo " - arduino-build-test: Build and test the project"' >> /home/vscode/.bashrc + +# (Optional) Add fish-specific configuration if desired +# For example, you might add an alias file or welcome message for fish: +RUN mkdir -p /home/vscode/.config/fish && \ + echo 'set -gx PATH /usr/local/bin $PATH' >> /home/vscode/.config/fish/config.fish && \ + echo '# Welcome to the Fish shell inside the dev container!' >> /home/vscode/.config/fish/config.fish + +# Generate SSH keys and set proper ownership and permissions +RUN if [ ! -f /home/vscode/.ssh/id_rsa ]; then \ + ssh-keygen -t rsa -b 4096 -N "" -C "devcontainer@local" -f /home/vscode/.ssh/id_rsa && \ + chmod 600 /home/vscode/.ssh/id_rsa && \ + chmod 644 /home/vscode/.ssh/id_rsa.pub && \ + chown vscode:vscode /home/vscode/.ssh/id_rsa /home/vscode/.ssh/id_rsa.pub ; \ + fi diff --git a/.devcontainer/arduino-cli.yaml b/.devcontainer/arduino-cli.yaml index 6f63e9e..b776e10 100644 --- a/.devcontainer/arduino-cli.yaml +++ b/.devcontainer/arduino-cli.yaml @@ -12,4 +12,8 @@ compile: unittest: # These dependent libraries will be installed libraries: - - "OneWire" \ No newline at end of file + - "OneWire" +board_manager: + additional_urls: + - https://arduino.esp8266.com/stable/package_esp8266com_index.json + - https://dl.espressif.com/dl/package_esp32_index.json \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2e43242..98325ed 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,15 +1,23 @@ { "name": "Arduino Library Development", "dockerFile": "Dockerfile", + "mounts": [ + "source=devcontainer_ssh,target=/home/vscode/.ssh,type=volume", + "source=devcontainer_bash_history,target=/home/vscode/.bash_history,type=volume", + "source=devcontainer_fish_history,target=/home/vscode/.local/share/fish/fish_history,type=volume" + ], "customizations": { - "vscode": { - "extensions": [ - "vsciot-vscode.vscode-arduino", - "ms-vscode.cpptools" - ] - } + "vscode": { + "extensions": [ + "vsciot-vscode.vscode-arduino", + "ms-vscode.cpptools", + "ms-azuretools.vscode-docker", + "yzhang.markdown-all-in-one" + ] + } }, "postCreateCommand": "arduino-cli core install arduino:avr && arduino-cli lib install ArduinoUnit && /usr/local/bin/update-libraries.sh", "updateContentCommand": "/usr/local/bin/update-libraries.sh", "remoteUser": "vscode" -} + } + \ No newline at end of file diff --git a/DallasTemperature.h b/DallasTemperature.h index db0f9ce..675e00d 100644 --- a/DallasTemperature.h +++ b/DallasTemperature.h @@ -1,7 +1,7 @@ #ifndef DallasTemperature_h #define DallasTemperature_h -#define DALLASTEMPLIBVERSION "4.0.3" +#define DALLASTEMPLIBVERSION "4.0.4" // Configuration #ifndef REQUIRESNEW diff --git a/library.json b/library.json index af6e85c..a5d8b09 100644 --- a/library.json +++ b/library.json @@ -32,7 +32,7 @@ { "paulstoffregen/OneWire": "^2.3.5" }, - "version": "4.0.3", + "version": "4.0.4", "frameworks": "arduino", "platforms": "*" } diff --git a/library.properties b/library.properties index c94891c..ecf548f 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=DallasTemperature -version=4.0.3 +version=4.0.4 author=Miles Burton , Tim Newsome , Guil Barros , Rob Tillaart maintainer=Miles Burton sentence=Arduino library for Dallas/Maxim temperature ICs