1. class Compiler does Systemic {
  2. has Str $.id;
  3. has Str $.release;
  4. has Str $!build-date;
  5. has Str $.codename;
  6. BEGIN my $id = $*W.handle.Str ~ '.' ~ nqp::time_n();
  7. submethod BUILD (
  8. :$!name = 'rakudo',
  9. :$!auth = 'The Perl Foundation',
  10. :$version,
  11. :$release,
  12. :$build-date,
  13. :$codename
  14. --> Nil
  15. ) {
  16. # XXX Various issues with this stuff on JVM
  17. my Mu $compiler := nqp::getcurhllsym('$COMPILER_CONFIG');
  18. $!id = nqp::p6box_s(nqp::ifnull(nqp::atkey($compiler,'id'),$id));
  19. $!version = Version.new(
  20. $version // nqp::p6box_s(nqp::atkey($compiler, 'version')) );
  21. $!release =
  22. $release // nqp::p6box_s(nqp::atkey($compiler, 'release-number'));
  23. $!build-date =
  24. $build-date // nqp::p6box_s(nqp::atkey($compiler, 'build-date'));
  25. $!codename =
  26. $codename // nqp::p6box_s(nqp::atkey($compiler, 'codename'));
  27. }
  28. method build-date() {
  29. DateTime.new($!build-date)
  30. }
  31. }