590 likes | 716 Views
Sweet Talk (part 2) Tool Support for Sweet. Phil Quitslund. Plan. Sweet Tooling issues Introduction to Eclipse Sweet Plugin at a glance Implementation notes Pitch and Caveats Where next. Plan. Sweet Tooling issues Introduction to Eclipse Sweet Plugin at a glance Implementation notes
E N D
Sweet Talk (part 2)Tool Support for Sweet Phil Quitslund
Plan • Sweet Tooling issues • Introduction to Eclipse • Sweet Plugin at a glance • Implementation notes • Pitch and Caveats • Where next
Plan • Sweet Tooling issues • Introduction to Eclipse • Sweet Plugin at a glance • Implementation notes • Pitch and Caveats • Where next
Automating the Build The Problem: Manual builds considered painful
Automating the Build The Problem: Manual builds considered painful • generative techniques require extra steps to stage builds
Automating the Build The Problem: Manual builds considered painful • generative techniques require extra steps to stage builds the rub: manual builds hurt and interrupt programmer flow
Automating the Build public abstract class List { public case Nil public case Cons(private int head, private List tail) } public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); }
Automating the Build public abstract class List { public case Nil public case Cons(private int head, private List tail) } public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); }
Automating the Build public abstract class List { public case Nil public case Cons(private int head, private List tail) } public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); } 3 “Introductions”
Automating the Build public abstract class List { public case Nil public case Cons(private int head, private List tail) } public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); }
S Automating the Build repository
J J J S Automating the Build repository
J J J S C C C Automating the Build repository
Managing Dependencies The Problem: Crufty Orphans
Managing Dependencies The Problem: Crufty Orphans • generated files are "orphaned" when their introductions get removed.
Managing Dependencies The Problem: Crufty Orphans • generated files are "orphaned" when their introductions get removed. the rub: manual maintenance is tedious and error prone
J J J S C C C Managing Dependencies repository
J J J S C C C Managing Dependencies repository
J J J S C C C Managing Dependencies repository
J J J S C C C Managing Dependencies repository
J J S C C C Managing Dependencies repository
J J S C C Managing Dependencies repository
J J S C C Managing Dependencies repository Done manually this is tedious and prone to error!
Error Handling The Problem: Say What?
Error Handling • Errors in generated files can be hard to trace back to their source The Problem: Say What?
Error Handling • Errors in generated files can be hard to trace back to their source The Problem: Say What? the rub: indirection decreases understandability
Error Reporting public abstract class List { public case Nil public case Cons(private int head, private List tail) } public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); }
Error Reporting public abstract class List { public case Nil public case Cons(private int head, private List tail) } public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); } Legal Sweet
Error Reporting public abstract class List { public case Nil public case Cons(private int head, private List tail) } public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); } case Nil { return 1; } Legal Sweet?
Error Reporting public abstract class List { public case Nil public case Cons(private int head, private List tail) } public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); } case Nil { return 1; } Legal Sweet? Nope…
Error Reporting public abstract class List { public case Nil public case Cons(private int head, private List tail) } public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); } case Nil { return 1; } Conflicting declarations
S S S Error Reporting (from 10,000ft) repository
S S S Error Reporting (from 10,000ft) repository
S S S Error Reporting (from 10,000ft) repository
S S S Error Reporting (from 10,000ft) repository
S S S Error Reporting (from 10,000ft) repository
Plan • Sweet Tooling issues • Introduction to Eclipse • Sweet Plugin at a glance • Implementation notes • Pitch and Caveats • Where next
What is Eclipse? • A universal platform for integrating development tools • “An IDE for everything and nothing in particular” • An open, extensible architecture based on plug-ins
What is Eclipse? (a picture) Another Tool Eclipse Platform Workbench Help Java Development Tools (JDT) JFace SWT Team Sweet Plugin Plug-in Development Environment (PDE) Workspace Debug Stellation Platform Runtime Eclipse Project
What is Eclipse? • Lot’s for free (well almost) • Tight integration of common core tools • CVS, Ant, JUnit, diff • Extensible/open architecture • Third-party plugins • ruby, c#, php, etc. • AOSD (aspectJ, hyperJ, FEAT, JQuery, etc)
Plan • Sweet Tooling issues • Introduction to Eclipse • Sweet Plugin at a glance • Implementation notes • Pitch and Caveats • Where next
Plugin Features • Keyword awareness • Integrated SweetBuilder • Automated House-Cleaning • Artifact Special Treatment • Basic Error-Reporting • Integrated Help
DEMO!! Cross fingers please…
Plan • Sweet Tooling issues • Introduction to Eclipse • Sweet Plugin at a glance • Implementation notes • Pitch and Caveats • Where next
Automating the Build (Impl.) - Eclipse leverages the Observer (Listener) Design Pattern The idea is to register listeners to monitor for changes to resources that should trigger a build.
Automating the Build (Impl.) • Our pipeline:
Automating the Build (Impl.) • Our pipeline: • Ordered list of builders • Insert SweetBuilder before JavaBuilder SB JB
Managing Dependencies (Impl.) Possible Approach: Parallel Worlds
Managing Dependencies (Impl.) Possible Approach: Parallel Worlds Possible Solution: “make clean”
Managing Dependencies (Impl.) - Complete rebuild - Worst case every Java file re-compiled • File-based - subtler: de-values artifacts • In a multi-view setting should be first-class! Parallel Worlds Disadvantages