dalehenrich / metacello_old

Development of Metacello on github has been moved to a https://github.com/dalehenrich/metacello-work. Metacello is a package management system for Smalltalk
http://code.google.com/p/metacello/
MIT License
9 stars 0 forks source link

cleaner JSON file format ... for dependencies #3

Open dalehenrich opened 12 years ago

dalehenrich commented 12 years ago

from Philippe Marschall:

{
"packages": [
{"Metacello-MC": {
"requires" : ["Metacello-Core", "Gofer"]},
{"Metacello-FileTree":
"requires" : ["Metacello-MC", "FileTree"]}}, 
],
"baselines": {
"packages": ["Metacello-MC", "Metacello-FileTree"]
}
}
dalehenrich commented 12 years ago

Pulling the conditional expressions into the packages themselves seems to be a much better way to convey the information to a human ... so the following:

{"baseline" : [ 
  {"projects" : [
      { "External" : { "repositories" : [ "github://dalehenrich/external/core" ]}}]},
  {"packages" : [
      { "Sample-Core" : {
                    "requires" : ["External"],
                    "includes" : ["Sample-Platform"]}},
      { "Sample-Platform" : { 
                    "requires" : ["Sample-Core"],
                    "conditional" : [
                        {"gemstone" : [
                          { "file" : "Sample-Platform.gemstone"}],
                        {"pharo" : [
                          { "file" : "Sample-Platform.pharo"}],
                        {"squeak" : [
                          { "file" : "Sample-Platform.squeak"}]]}},
      { "Sample-Tests" : { "requires" : ["Sample-Core"]}}]}]}

is more clear than this:

{"baseline" : [ 
      {"common" : 
          [ 
          {"githubs" : [ 
              { "External" : { 
                  "repositories" : [ "github://dalehenrich/external/core"]}}]},
          {"packages" : [ 
              { "Sample-Core" : { 
                  "requires" : ["External"],
                  "includes" : ["Sample-Platform"]}},
              { "Sample-Platform" : { 
                  "requires" : ["Sample-Core"]}},
              { "Sample-Tests" : { 
                  "requires" : ["Sample-Core"]}}]}]},
      {"gemstone" : 
          [ 
          {"packages" : [ 
              { Sample-Platform" : { 
                  "file" : "Sample-Platform.gemstone"}}]}]},
      {"pharo" : 
          [ 
          {"packages" : [ 
              { "Sample-Platform" : { 
                  "file" : "Sample-Platform.pharo"}}]}]},
      {"squeak" : 
          [ 
          {"packages" : [ 
              { "Sample-Platform" : { 
                  "file" : "Sample-Platform.squeak"}}]}]}]}

but I don't like the "conditional" field name ... it is too contrived and could collide with group names