Permalink
Commits on Aug 29, 2016
  1. @cmaglie
  2. @facchinm

    update arduino-builder to 1.3.21

    jenkins committed with facchinm Aug 26, 2016
  3. @facchinm

    Merge pull request #5309 from ChisholmKyle/patch-1

    remove extra semicolon
    facchinm committed on GitHub Aug 29, 2016
  4. @facchinm

    Merge pull request #5297 from aykevl/doc-option-useprogrammer

    Add '--useprogrammer' option to the man page
    facchinm committed on GitHub Aug 29, 2016
  5. @ChisholmKyle

    remove extra semicolon

    I was compiling with -Werror and this little error popped up
    ChisholmKyle committed on GitHub Aug 29, 2016
Commits on Aug 28, 2016
  1. @NicoHood
Commits on Aug 26, 2016
  1. @aykevl
  2. @facchinm

    Starting version 1.6.12

    facchinm committed Aug 26, 2016
  3. @facchinm
  4. @facchinm

    Fix rebase errors

    facchinm committed Aug 26, 2016
  5. @facchinm

    update API to v1

    facchinm committed Aug 12, 2016
  6. @facchinm

    Add Cloud API integration

    This method discovers if a connected board needs an additional core and helps the user downloading it via BoardManager
    facchinm committed Aug 11, 2016
  7. @facchinm
  8. @matthijskooijman @facchinm

    Update comment

    This comment still talked about Processing related stuff which doesn't
    really apply anymore.
    matthijskooijman committed with facchinm Dec 30, 2015
  9. @matthijskooijman @facchinm

    In `Base.handleOpen()`, compare Files rather than Strings

    Comparing a File object automatically takes care of filesystem case
    sensitivity, whereas strings do not, so this makes the comparison
    slightly more reliable.
    matthijskooijman committed with facchinm Dec 29, 2015
  10. @matthijskooijman @facchinm

    Randomize the the build path name

    Previously, this used a hash of the sketch filename, so the same build
    path would be generated for the same sketch between multiple
    compilations. Now that the build path is stored, this requirement has
    disappeared, so a random filename can be generated again. While here,
    this commit also changes the prefix from "build" to "arduino_build_",
    which makes it a bit more clear what the directory's purpose is.
    matthijskooijman committed with facchinm Dec 29, 2015
  11. @matthijskooijman @facchinm

    Store the build path used in Sketch

    Previously, everywhere where it was needed, the path was requested from
    BaseNoGui. Because the path is based on a hash of the sketch filename,
    every caller would get the same path for the same sketch.
    
    However, it makes more sense to store the path used for a given sketch
    inside the Sketch object. This prevents having to pass around or
    regenerate the build path everywhere, and no longer requires the build
    path to be deterministic (though it still is in this commit).
    
    This allows removing some methods and constructors of which two versions
    were available - one with a build path argument and one without.
    matthijskooijman committed with facchinm Dec 29, 2015
  12. @matthijskooijman @facchinm

    Let SketchFile figure out if it is primary by itself

    Previously, the caller of the constructor did this, but now that
    SketchFile keeps a reference to its containing sketch, it can figure it
    out itself.
    matthijskooijman committed with facchinm Dec 29, 2015
  13. @matthijskooijman @facchinm

    Let `SketchFile.delete()` call `Sketch.removeFile()`

    Previously, callers of `SketchFile.delete()` would also call
    `Sketch.removeFile()`, but letting SketchFile handle this is more
    robust.
    
    This is possible now that SketchFile keeps a reference to Sketch and
    makes updating the Sketch file list less fragile.
    
    Eventually this might be further decoupled by letting SketchFile
    broadcast a "deleted" event instead.
    matthijskooijman committed with facchinm Dec 29, 2015
  14. @matthijskooijman @facchinm

    Rename `SketchFile.deleteFile()` to `delete()`

    The extra "File" in the name was a bit redundant, and this is more
    consistent with `Sketch.delete()`.
    matthijskooijman committed with facchinm Dec 29, 2015
  15. @matthijskooijman @facchinm

    Move sketch deletion from SketchController into Sketch

    This isn't much code, but it makes deletion more consistent with
    renaming and saving with the SketchController handling the UI part and
    Sketch actually doing the delete.
    matthijskooijman committed with facchinm Dec 29, 2015
  16. @matthijskooijman @facchinm

    Merge `Sketch.renameFileTo()` into `SketchFile.renameTo()`

    Now that SketchFile keeps a reference to its Sketch,
    `SketchFile.renameTo()` can call `Sketch.checkNewFilename()`, so there
    is no need for the renaming itself to go through Sketch.
    
    This changes the parameter for `SketchFile.renameTo()` from File to
    String, to enforce that only the filename is changed, not the directory
    name.
    matthijskooijman committed with facchinm Dec 29, 2015
  17. @matthijskooijman @facchinm

    Let SketchFile store a reference to the Sketch it belongs to

    This allows simplifying some other things later.
    matthijskooijman committed with facchinm Dec 29, 2015
  18. @matthijskooijman @facchinm
  19. @matthijskooijman @facchinm

    Remove `Base.removeDir()` and `Base.removeDescendants()`

    These methods shouldn't really be in Base (or BaseNoGui, which did the
    actual work), especially since there is already a
    `FileUtils.recursiveDelete()` which just does the same thing. This
    commit removes the code from Base and BaseNoGui and instead uses the
    method from FileUtils.
    
    There is one difference between these methods: the Base methods did not
    delete files if the "compiler.save_build_files" preference was set.
    However, the Base methods were only used when deleting a sketch, or
    deleting an existing folder before overwriting it on save as, so this
    preference didn't actually do what it was supposed to anyway, so
    dropping it shouldn't be a problem.
    matthijskooijman committed with facchinm Dec 29, 2015
  20. @matthijskooijman @facchinm

    Refactor file adding and renaming, and save as handling

    This commits replaces a significant part of the code handling these
    features. A lot of responsibilities are moved from SketchController to
    Sketch, though the code involved is rewritten mostly.
    
    Most of the handling now happens inside Sketch, including various checks
    against the new filename. Basically SketchController processes the user
    input to decide what needs to be done, and Sketch checks if it can be
    done and does it.
    
    If problems occur, an IOException is thrown, using a translated error
    message that is shown by SketchController as-is. This might not be the
    best way to transfer error messages (regular IOExceptions might contain
    less-friendly messages), so this might need further improvement later.
    
    In addition to moving around code and responsibilities, this code also
    changes behaviour in some places:
     - Because Sketch and SketchFile are now in control of renames and
       saves, they can update their internal state after a rename. This
       removes the need for reloading the entire sketch after a rename or
       save as and allows `Editor.handleOpenUnchecked()` to be removed.
     - When renaming the entire sketch, all files used to be saved before
       renaming, since the sketch would be re-opened after renaming. Since
       the re-opening no longer happens, there is no longer a need to save
       the sketch, so any unsaved changes remain unsaved in the editor after
       renaming the sketch.
     - When renaming or adding new files, duplicate filenames are detected.
       Initially, this happened case sensitively, but it was later changed to
       use case insensitive matching to prevent problems on Windows (where
       filenames cannot differ in just case). To prevent complexity, this
       did not distinguish between systems. In commit 5fbf962 (Sketch
       rename: allowig a case change rename if NOT on windows), the
       intention was to only do case insensitive checking on Windows, but it
       effectively disabled all checking on other systems, making the check
       not catch duplicate filenames at all.
    
       With this commit, all these checks are done using `File.equals()`
       instead of comparing strings, which is already aware of the case
       sensitivity of the platform and should act accordingly.
     - Some error messages were changed.
     - When adding a file, an empty file is not created directly, but only a
       SketchFile and EditorTab is added. When the sketch is saved, the file
       is created.
     - When importing a file that already exists (thus overwriting it),
       instead of replacing the SketchFile instance, this just lets the
       EditorTab reload its contents. This was broken since the introduction
       of EditorTab. The file would be replaced, but not this was not
       reflected in the editor, which is now fixed. This change allows
       `Sketch.replaceFile()` to be removed.
     - When importing a file that does not exist yet (thus adding it), a tab
       is now also added for it (in addition to a SketchFile). This was
       broken since the introduction of EditorTab, and would result in the
       file being added, but not shown in the editor.
    
    This commit adds a `Sketch.renameFileTo()` method, to rename a single
    file within the sketch. It would be better to integrate its contents
    into `Sketch.renameTo()`, but that does not have access to the `Sketch`
    instance it is contained in. This will be changed in a future commit.
    matthijskooijman committed with facchinm Dec 21, 2015
  21. @matthijskooijman @facchinm

    Use `File.getParentFile()` in Sketch constructor

    No need to call the File constructor ourselves, if
    `File.getParentFile()` can just do that for us.
    matthijskooijman committed with facchinm Dec 21, 2015
  22. @matthijskooijman @facchinm

    Clean up pde to ino renaming

    This makes a few related changes:
     - `FileUtils.replaceExtension()` is introduced to handle replacing the
       .pde extension with .ino.
     - Instead of iterating .pde files on disk, this iterates SketchFiles in
       memory, saving another lookup from filename -> SketchFile later.
     - `SketchController.renameCodeToInoExtension()` is removed. Now it no
       longer needs to look up the SketchFile and FileUtils handles the
       extension replacement, this method did not have any reason to exist
       anymore.
     - Instead of hardcoding the .pde extension, a new
       Sketch.OLD_SKETCH_EXTENSIONS constant is introduced.
    matthijskooijman committed with facchinm Dec 21, 2015
  23. @matthijskooijman @facchinm

    Remove `Base.copyDir()`

    There was already a nearly identical `FileUtils.copy()` that copies
    directories recursively.
    
    The only difference is that now hidden files *are* copied, but version
    control files (according the list in FileUtils) are not. Since this only
    affects the copying of the "data" directory during save as, this
    should not be much of a problem.
    matthijskooijman committed with facchinm Dec 18, 2015
  24. @matthijskooijman @facchinm

    Do not store the sketch name in Sketch

    Sketch already stores the sketch folder, and the sketch name should be
    identical to the folder name. In the case where the filename passed to
    the sketch constructor is not the primary .ino file (named after the
    sketch), this will slightly change behaviour. However, the calling code
    should prevent this from happening, and with the old code, some internal
    assumptions were probably violated, so this changes makes handling this
    situation a bit more robust.
    
    Since the actual filename passed to Sketch is no longer used, it is no
    longer required to pass the name of the primary .ino file. At some
    point, the constructor should probably be changed to accept a folder
    name instead of a filename, but that would require a lot of changes
    to trace this back through the code, so this is something for later.
    matthijskooijman committed with facchinm Dec 18, 2015
  25. @matthijskooijman @facchinm

    Change `Compiler.pathToSketch` from String to File

    Keeping filenames as File objects for as long as possible is generally a
    good idea and this removes a dependency on `Sketch.getMainFilePath()`,
    so it can be removed later.
    matthijskooijman committed with facchinm Dec 18, 2015
  26. @matthijskooijman @facchinm

    Let Sketch.getPrimaryFile return a SketchFile

    Previously, it returned a File object, which the Sketch separately
    stored from the primary SketchFile. By letting it just return the
    SketchFile, and let callers query that for the filename, Sketch does not
    need to store the File object itself and there is less chance of info
    getting out of sync.
    matthijskooijman committed with facchinm Dec 18, 2015
  27. @matthijskooijman @facchinm

    Do not store the "data" folder in Sketch

    Instead, just the File object when requested. It is not used during
    normal operation (just when adding files, or using save as), so no point
    in already creating the object in the constructor.
    matthijskooijman committed with facchinm Dec 18, 2015
  28. @matthijskooijman @facchinm

    Allow .cpp files named after the primary .ino file

    This limitation was added a long time ago, when the build system did not
    cope with this. The current build system handles this situation just
    fine, so this limitation can be lifted.
    matthijskooijman committed with facchinm Dec 17, 2015
  29. @matthijskooijman @facchinm

    Remove `Base.handle*Replace()`

    These methods dealt with opening up a sketch inside an existing editor
    window, but they were unused - all sketches open in a new window now.
    matthijskooijman committed with facchinm Dec 17, 2015