Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
6 changes: 5 additions & 1 deletion .devcontainer/arduino-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ compile:
unittest:
# These dependent libraries will be installed
libraries:
- "OneWire"
- "OneWire"
board_manager:
additional_urls:
- https://arduino.esp8266.com/stable/package_esp8266com_index.json
- https://dl.espressif.com/dl/package_esp32_index.json
22 changes: 15 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
}
}

2 changes: 1 addition & 1 deletion DallasTemperature.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef DallasTemperature_h
#define DallasTemperature_h

#define DALLASTEMPLIBVERSION "4.0.3"
#define DALLASTEMPLIBVERSION "4.0.4"

// Configuration
#ifndef REQUIRESNEW
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
{
"paulstoffregen/OneWire": "^2.3.5"
},
"version": "4.0.3",
"version": "4.0.4",
"frameworks": "arduino",
"platforms": "*"
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=DallasTemperature
version=4.0.3
version=4.0.4
author=Miles Burton <[email protected]>, Tim Newsome <[email protected]>, Guil Barros <[email protected]>, Rob Tillaart <[email protected]>
maintainer=Miles Burton <[email protected]>
sentence=Arduino library for Dallas/Maxim temperature ICs
Expand Down
Loading