Skip to content

Commit 008c75d

Browse files
committed
Merge branch 'master' into arduifine
2 parents e096970 + 382ebf1 commit 008c75d

File tree

6 files changed

+12
-60
lines changed

6 files changed

+12
-60
lines changed

Diff for: arduino/libraries/librariesresolver/cpp.go

+5-8
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ func computePriority(lib *libraries.Library, header, arch string) int {
121121
header = strings.TrimSuffix(header, filepath.Ext(header))
122122
header = simplify(header)
123123
name := simplify(lib.Name)
124-
realName := simplify(lib.RealName)
125124

126125
priority := 0
127126

@@ -138,17 +137,15 @@ func computePriority(lib *libraries.Library, header, arch string) int {
138137
priority += 0
139138
}
140139

141-
if realName == header && name == header {
142-
priority += 600
143-
} else if realName == header || name == header {
140+
if name == header {
144141
priority += 500
145-
} else if realName == header+"-master" || name == header+"-master" {
142+
} else if name == header+"-master" {
146143
priority += 400
147-
} else if strings.HasPrefix(realName, header) || strings.HasPrefix(name, header) {
144+
} else if strings.HasPrefix(name, header) {
148145
priority += 300
149-
} else if strings.HasSuffix(realName, header) || strings.HasSuffix(name, header) {
146+
} else if strings.HasSuffix(name, header) {
150147
priority += 200
151-
} else if strings.Contains(realName, header) || strings.Contains(name, header) {
148+
} else if strings.Contains(name, header) {
152149
priority += 100
153150
}
154151

Diff for: arduino/libraries/librariesresolver/cpp_test.go

-15
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,3 @@ func TestCppHeaderResolver(t *testing.T) {
143143
require.Equal(t, "Calculus Unified Lib", resolve("calculus_lib.h", l6, l7))
144144
require.Equal(t, "Calculus Unified Lib", resolve("calculus_lib.h", l7, l6))
145145
}
146-
147-
func TestCppHeaderResolverWithLibrariesInStrangeDirectoryNames(t *testing.T) {
148-
resolver := NewCppResolver()
149-
librarylist := libraries.List{}
150-
librarylist.Add(&libraries.Library{Name: "onewire_2_3_4", RealName: "OneWire", Architectures: []string{"*"}})
151-
librarylist.Add(&libraries.Library{Name: "onewireng_2_3_4", RealName: "OneWireNg", Architectures: []string{"avr"}})
152-
resolver.headers["OneWire.h"] = librarylist
153-
require.Equal(t, "onewire_2_3_4", resolver.ResolveFor("OneWire.h", "avr").Name)
154-
155-
librarylist2 := libraries.List{}
156-
librarylist2.Add(&libraries.Library{Name: "OneWire", RealName: "OneWire", Architectures: []string{"*"}})
157-
librarylist2.Add(&libraries.Library{Name: "onewire_2_3_4", RealName: "OneWire", Architectures: []string{"avr"}})
158-
resolver.headers["OneWire.h"] = librarylist2
159-
require.Equal(t, "OneWire", resolver.ResolveFor("OneWire.h", "avr").Name)
160-
}

Diff for: cli/config/validate.go

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ var validMap = map[string]reflect.Kind{
3333
"sketch.always_export_binaries": reflect.Bool,
3434
"metrics.addr": reflect.String,
3535
"metrics.enabled": reflect.Bool,
36+
"network.proxy": reflect.String,
37+
"network.user_agent_ext": reflect.String,
3638
}
3739

3840
func typeOf(key string) (reflect.Kind, error) {

Diff for: docs/sketch-specification.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ The programs that run on Arduino boards are called "sketches". This term was inh
55

66
## Sketch folders and files
77

8+
The sketch root folder name and code file names must start with a basic letter (`A`-`Z` or `a`-`z`) or number (`0`-`9`),
9+
followed by basic letters, numbers, underscores (`_`), dots (`.`) and dashes (`-`). The maximum length is 63 characters.
10+
11+
Support for names starting with a number was added in Arduino IDE 1.8.4.
12+
813
### Sketch root folder
914

1015
Because many Arduino sketches only contain a single .ino file, it's easy to think of that file as the sketch. However,
1116
it is the folder that is the sketch. The reason is that sketches may consist of multiple code files and the folder is
1217
what groups those files into a single program.
1318

14-
The sketch root folder name must start with a basic letter (`A`-`Z` or `a`-`z`) or number (`0`-`9`), followed by basic
15-
letters, numbers, underscores (`_`), dots (`.`) and dashes (`-`). The maximum length is 63 characters.
16-
17-
Support for sketch folder names starting with a number was added in Arduino IDE 1.8.4.
18-
1919
### Primary sketch file
2020

2121
Every sketch must contain a `.ino` file with a file name matching the sketch root folder name.

Diff for: test/test_compile.py

-25
Original file line numberDiff line numberDiff line change
@@ -998,31 +998,6 @@ def test_recompile_with_different_library(run_command, data_dir):
998998
assert f"Using previously compiled file: {obj_path}" not in res.stdout
999999

10001000

1001-
def test_compile_with_conflicting_libraries_include(run_command, data_dir, copy_sketch):
1002-
assert run_command("update")
1003-
1004-
assert run_command("core install arduino:[email protected]")
1005-
1006-
# Install conflicting libraries
1007-
git_url = "https://github.com/pstolarz/OneWireNg.git"
1008-
one_wire_ng_lib_path = Path(data_dir, "libraries", "onewireng_0_8_1")
1009-
assert Repo.clone_from(git_url, one_wire_ng_lib_path, multi_options=["-b 0.8.1"])
1010-
1011-
git_url = "https://github.com/PaulStoffregen/OneWire.git"
1012-
one_wire_lib_path = Path(data_dir, "libraries", "onewire_2_3_5")
1013-
assert Repo.clone_from(git_url, one_wire_lib_path, multi_options=["-b v2.3.5"])
1014-
1015-
sketch_path = copy_sketch("sketch_with_conflicting_libraries_include")
1016-
fqbn = "arduino:avr:uno"
1017-
1018-
res = run_command(f"compile -b {fqbn} {sketch_path} --verbose")
1019-
assert res.ok
1020-
lines = [l.strip() for l in res.stdout.splitlines()]
1021-
assert 'Multiple libraries were found for "OneWire.h"' in lines
1022-
assert f"Used: {one_wire_lib_path}" in lines
1023-
assert f"Not used: {one_wire_ng_lib_path}" in lines
1024-
1025-
10261001
def test_compile_with_invalid_build_options_json(run_command, data_dir):
10271002
assert run_command("update")
10281003

Diff for: test/testdata/sketch_with_conflicting_libraries_include/sketch_with_conflicting_libraries_include.ino

-7
This file was deleted.

0 commit comments

Comments
 (0)