File tree Expand file tree Collapse file tree 3 files changed +30
-63
lines changed Expand file tree Collapse file tree 3 files changed +30
-63
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ import (
3939type ContainerMergeCopySketchFiles struct {}
4040
4141func (s * ContainerMergeCopySketchFiles ) Run (ctx * types.Context ) error {
42+ offset , source := bldr .MergeSketchSources (types .SketchFromLegacy (ctx .Sketch ))
43+ ctx .LineOffset = offset
44+ ctx .Source = source
45+
4246 if err := new (SketchSourceMerger ).Run (ctx ); err != nil {
4347 return i18n .WrapError (err )
4448 }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -148,6 +148,32 @@ func SketchToLegacy(sketch *sketch.Sketch) *Sketch {
148148 return s
149149}
150150
151+ func SketchFromLegacy (s * Sketch ) * sketch.Sketch {
152+ others := []* sketch.Item {}
153+ for _ , f := range s .OtherSketchFiles {
154+ if i , err := sketch .NewItem (f .Name .String ()); err == nil {
155+ others = append (others , i )
156+ }
157+ }
158+
159+ additional := []* sketch.Item {}
160+ for _ , f := range s .AdditionalFiles {
161+ if i , err := sketch .NewItem (f .Name .String ()); err == nil {
162+ additional = append (additional , i )
163+ }
164+ }
165+
166+ return & sketch.Sketch {
167+ MainFile : & sketch.Item {
168+ Path : s .MainFile .Name .String (),
169+ Source : []byte (s .MainFile .Source ),
170+ },
171+ LocationPath : s .MainFile .Name .Parent ().String (),
172+ OtherSketchFiles : others ,
173+ AdditionalFiles : additional ,
174+ }
175+ }
176+
151177type PlatforKeysRewrite struct {
152178 Rewrites []PlatforKeyRewrite
153179}
You can’t perform that action at this time.
0 commit comments