You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| loadSpec projectsHome resolvedProject definedProject pharoComponentName pharoPackageName pharoPackage testPackage className classDefinition |
projectsHome := '/bosch1/users/dhenrich/_stones/git/'.
loadSpec := RwSpecification fromUrl: 'file://', projectsHome, '/BitmapCharacterSet/rowan/specs/BitmapCharacterSet-Tests.ston'.
resolvedProject := loadSpec resolveProject.
resolvedProject := Rowan
projectFromUrl: 'file://', projectsHome, '/BitmapCharacterSet/rowan/specs/BitmapCharacterSet-Tests.ston'
diskUrl: 'file://', projectsHome, '/BitmapCharacterSet'.
"A resolved project is ready to be loaded, but we are interested in making changes to the project,
so we need a defined project."
definedProject := resolvedProject defined.
pharoComponentName := 'Pharo'.
definedProject
addLoadComponentNamed: pharoComponentName
comment: 'placeholder component, since packages must be managed by a component'.
pharoPackageName := 'Collections-BitmapCharacterSet-Tests-Pharo'.
className := 'ManifestCollectionsBitmapCharacterSetTests'.
testPackage := definedProject packageNamed: 'Collections-BitmapCharacterSet-Tests'.
classDefinition := testPackage removeClassNamed: className.
false ifTrue: [
"workaround for issue"
definedProject export. "export reads packages from disk to write diffs, but that ends restoring the removed class"
].
classDefinition category: pharoPackageName.
pharoPackage := definedProject addPackageNamed: pharoPackageName toComponentNamed: pharoComponentName.
pharoPackage addClassDefinition: classDefinition.
definedProject export
After running this script both the Collections-BitmapCharacterSet-Tests-Pharo and Collections-BitmapCharacterSet-Tests packages end up with a ManifestCollectionsBitmapCharacterSetTests class ...
The workaround is to export the project immediately after the class definition is removed and before the class definition is added to the new package ....
To be clear it is the MOVE of the class definition from one package to another that causes the issue ... the export package algorithm reads the packages from disk into a copy of the project (restoring the class definition that was removed) ... which is whey the workaround works :)
The text was updated successfully, but these errors were encountered:
The following example script run against tukanos/BitmapCharacterSet: 659c7b490 illustrates the issue:
After running this script both the
Collections-BitmapCharacterSet-Tests-Pharo
andCollections-BitmapCharacterSet-Tests
packages end up with aManifestCollectionsBitmapCharacterSetTests
class ...The workaround is to export the project immediately after the class definition is removed and before the class definition is added to the new package ....
To be clear it is the MOVE of the class definition from one package to another that causes the issue ... the export package algorithm reads the packages from disk into a copy of the project (restoring the class definition that was removed) ... which is whey the workaround works :)
The text was updated successfully, but these errors were encountered: