Acknowledged

RFC: Allow (:test) annotation in a Barrel to exist without (:release) and (:debug) annotation

module Barrel {

  (:test)
  module TestingModule {
  
    function foo() {
      // code here
    }
  }
}

This currently doesn't work like one expects:

The annotation (:test) is defined for Barrel.TestingModule but is not indicated as a supported annotation in the manifest file.

When you put it in the manifest and run the test it works, but as soon as you run a release build the symbols disappear and the tests files cannot be compiled.

So if you want modules to be only used in the testing phase you need to make files that implement :release and :debug annotations as well, which you need to export and than import again on the consuming module end. Which open up some other interesting behaviours.

module Barrel {

  (:release) // and release
  module TestingModule {
    // Without functions because you get errors otherwise:
    // Duplicate declaration of symbol 'foo' in module 'TestingModule'.
    // This in itself might be another bug with barrels because this prevents
    // you from making a two methods for different annotations which do the
    // same depending on the device
  }
}

module Barrel {

  (:debug) // and release
  module TestingModule {
    // For some reason you don't get the duplicate declaration warning in the debug
    // annotation during the barrelbuild, but you get it on app build
  }
}

This makes Barrels or functions in barrels that only implement testing features (eg, mocked clases etc) a bit difficult, as you need expose the two other annotations as well.

I have some thoughts on this;

1) Allow to specificy a test directory in your monkey.jungle file, this will be excluded from debug and release builds. This allows exclusion without Barrels. That way we don't need to worry about release and debug annotations in barrels when only test annotations are present. But doesn't really hop over to debug and release annotations in barrels. 

2) As soon as a (:test) annotation in a barrel on a module is found, the release and debug boilerplate is added by the compiler. I also think test, release and debug don't need to be mentioned in the manifest file as they are present for each project already.