Skip to content

Instantly share code, notes, and snippets.

@baroquebobcat
Created July 22, 2012 20:17
Show Gist options
  • Select an option

  • Save baroquebobcat/3160938 to your computer and use it in GitHub Desktop.

Select an option

Save baroquebobcat/3160938 to your computer and use it in GitHub Desktop.
Mirah Office Hours: July 22nd

Mirah Office Hours: July 22nd

  • Update bat file to do something nicer.

  • New Release

    • update versions
    • generate artifacts (gem, zip, jars)
    • test artifacts (gem, zip, mvn clean install, jars)
    • push artifacts
    • tag repo
  • mmeta pausable/continuable (REPL yak shaving)

  • update newast version, and check status


#bat file

done, just ripped out the for loop lookup, requiring JAVA_HOME to be set. More info http://donttreadonme.co.uk/mirah/2012/07/16.html#message_16

#New Release 0.0.12

The last release without the self-hosted AST (hopefully).

First things first, tests are passing on master.

tests on JRuby 1.6.7.2 with 1.9 mode fail because of http://jira.codehaus.org/browse/JRUBY-6497

$ rvm --create jruby-1.7.0.preview1@mirah_hacking
$ bundle
$ rake test

1.9 / 1.7.0 issues

AstTest
 FAIL (0:00:00.205) test_incorrect_syntax_raises_syntax_error
          [Mirah::SyntaxError] exception expected, not
          Class: <Java::Jmeta::SyntaxError>
          Message: <"expected comma before '<EOF>' (at line: 1, char: 12)">
          ---Backtrace---
          mirah.impl.MirahParser.paren_args(Mirah.mirah:4586)

ERROR (0:00:00.232) test_return
          assertion message must be String or Proc, but Fixnum was given.
        @ test/core/ast_test.rb:351:in `test_return'

ClassLoaderTest
 FAIL (0:00:00.278) test_mirah_class_loader_w_missing_class_raises_class_not_found
          [NativeException] exception expected, not
          Class: <Java::JavaLang::ClassNotFoundException>
          Message: <"org.doesnt.exist.Class">
          ---Backtrace---
MacrosTest
a bunch of these
 ERROR (0:00:14.132) test_macro_hygene
          argument type mismatch
        @ sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

RescueTest
              PASS (0:00:14.398) test_empty_rescues
              FAIL (0:00:14.765) test_rescue
          [NativeException] exception expected, not
          Class: <Java::JavaLang::Exception>
          Message: <"!x">
          ---Backtrace---

hm. should I abort due to these? The NativeException bits are due to fixes in JRuby's Exception wrapping code. The other ones concern me.

New ast has some 1.9 errors as well, but different ones. in particular, there's code that calls each_with_index on strings. But 1.9 strings don't have that method.

update versions

$ git ci -am "bump versions to 0.0.12"
[master c06e1df] bump versions to 0.0.12
 4 files changed, 6 insertions(+), 6 deletions(-)

let's build some artifacts

$ rake clean clobber
$ rake dist
...
$ ll dist
total 52288
-rw-r--r--  1 nick  staff  12583635 Jul 22 14:31 mirah-0.0.12.zip
-rw-r--r--  1 nick  staff  13990832 Jul 22 14:31 mirah-complete.jar
-rw-r--r--  1 nick  staff    190006 Jul 22 14:31 mirah.jar
$ ll pkg/
total 25160
drwxr-xr-x  10 nick  staff       340 Jul 22 14:31 mirah-0.0.12-java
-rw-r--r--   1 nick  staff  12878848 Jul 22 14:31 mirah-0.0.12-java.gem

test'm

$ rvm --create jruby@mirah_release_7_22_2012
$ gem install pkg/mirah-0.0.12-java.gem 
Fetching: bitescript-0.1.0.gem (100%)
Successfully installed bitescript-0.1.0
Successfully installed mirah-0.0.12-java
2 gems installed
$ cd /tmp
$ $ mirah -e 'puts "hello"'
hello

gem looks ok.

$ echo 'puts 1' > test.mirah
$ java -cp dist/mirah-complete.jar org.mirah.MirahCommand run test.mirah
1

jar looks ok.

$ mvn clean install
$ java -cp /Users/nick/.m2/repository/org/mirah/mirah-complete/0.0.12/mirah-complete-0.0.12.jar org.mirah.MirahCommand run test.mirah
1

looks ok.

Pushing Files

$ gem push pkg/mirah-0.0.12-java.gem 

uploaded zip to downloads

$ mvn clean deploy

succeeded, but didn't work

$ mvn clean verify gpg:sign install:install deploy:deploy

succeeded, but didn't work

rereading the guide

fuck that's way more complicated than I hoped.

$ mvn javadoc:jar source:jar

are necessary according to the docs.

grr.

double grr. javadoc:jar didn't build any jars. off to the docs

Looking for a -DactuallyMakeTheFreakingJar=true option. Oh, I need to read the success message more carefully

 Not executing Javadoc as the project is not a Java classpath-capable package

trible grr.

Pushing signed artifacts to staging apparently works like this:

$ mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=dist/mirah-complete-0.0.12.pom -Dfile=dist/mirah-complete-0.0.12.jar

$ mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=dist/mirah-complete-0.0.12.pom -Dfile=dist/mirah-complete-0.0.12-sources.jar -Dclassifier=sources
$ mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=dist/mirah-complete-0.0.12.pom -Dfile=dist/mirah-complete-0.0.12-javadoc.jar -Dclassifier=javadoc

making a stupid javadoc jar.

$ mkdir maven/javadoc_contents
$ echo 'no javadocs' > maven/javadoc_contents/README
$ jar cf dist/mirah-complete maven/javadoc_contents/

Turns out they didn't care about those javadoc etc artifacts.

mvn clean deploy

did the right thing, I just needed to click through the freaking UI to do the release.

So, maven release steps:

run mvn clean deploy log into


TODO

  • make dist put the gem file in dist, or use dist for the gem task.
  • integrate maven steps as rake tasks.
    • figure out how to make maven use the jar generated by rake.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment