On Sun, Nov 30, 2008 at 3:46 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:

> OK, I have a  maven-lift plugin done with an i18ngen target that you can
> use to parse all of your Scala and xhtml sources for i18n keys (lift:loc,
> etc). The question now is, where should I put it? Should I put it in the
> main lift repo or just dump it in my own github repo?


Awesome stuff.

Please let DavidB decide how and where it should go.  I have a minor
preference for putting it right in Lift, but we don't really have a tools
section, so it might make more sense to have it live separately, but host
the compiled code on scala-tools.org.


>
>
> Derek
>
>
> On Fri, Nov 28, 2008 at 7:49 AM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:
>
>> Yes, I was just reading about writing Maven plugins yesterday for the I18N
>> tool and it looks like they depend heavily on javadoc-style annontations.
>> Right now that means the plugin I'm hacking on has a Scala implementation
>> with essentially a Java shim. I would much prefer to just have a single
>> scala plugin :)
>>
>> Derek
>>
>>
>> On Fri, Nov 28, 2008 at 6:34 AM, Josh Suereth <[EMAIL PROTECTED]>wrote:
>>
>>> Alright,
>>>
>>> My new side project is to be able to write maven plugins in the scala
>>> language.  Luckily for us JRuby and Groovy have already done this (although
>>> Groovy took a huge shortcut that JRuby/Scala are unable to use), so I have
>>> some great sample code.   Anyway, before I start cranking on this, just
>>> wanted to make sure this is needed/desired for future lift work?
>>>
>>> On Thu, Nov 27, 2008 at 10:27 PM, Josh Suereth <[EMAIL PROTECTED]
>>> > wrote:
>>>
>>>> The maven-scala-plugin is a great place to look to get started.  DavidB
>>>> did a great job on that.  Whenever I need to figure out how to do "maven
>>>> trickery" I usually just download the source to the closest plugin I can
>>>> think of.  I'm not sure anyone is doing maven plugins in pure-scala, which
>>>> might be a downside for the lift framework.
>>>>
>>>> Let me take a shot and see what's required to do a pure-scala maven
>>>> plugin.  If I'm quick, it might be out soon.
>>>>
>>>>
>>>> On Thu, Nov 27, 2008 at 12:09 PM, Jorge Ortiz <[EMAIL PROTECTED]>wrote:
>>>>
>>>>> Yeah, I'd love to make this a Maven build plugin. When it comes to
>>>>> Maven I'm a total dunce though, but I'll look into it.
>>>>>
>>>>> Any pointers on where to get started?
>>>>>
>>>>>
>>>>> On Thu, Nov 27, 2008 at 3:59 AM, Josh Suereth <
>>>>> [EMAIL PROTECTED]> wrote:
>>>>>
>>>>>> Hey, neat idea!   That will definitely help me avoid my own dumb
>>>>>> errors.
>>>>>>
>>>>>> I'm just throwing this out there, but would it make sense to try to
>>>>>> make this a Maven build plugin in the future?   That way you could 
>>>>>> control
>>>>>> where it runs in the lifecycle if you wanted to.
>>>>>>
>>>>>> -Josh
>>>>>>
>>>>>>
>>>>>> On Wed, Nov 26, 2008 at 8:07 PM, Jorge Ortiz <[EMAIL PROTECTED]>wrote:
>>>>>>
>>>>>>> Oops, it just test *.htm and *.xhtml files as well. Updated code
>>>>>>> below.
>>>>>>>
>>>>>>> --j
>>>>>>>
>>>>>>>   /**
>>>>>>>    * Tests to make sure the project's XML files are well-formed.
>>>>>>>    *
>>>>>>>    * Finds every *.html and *.xml file in src/main/webapp (and its
>>>>>>>    * subdirectories) and tests to make sure they are well-formed.
>>>>>>>    */
>>>>>>>   def testXml() = {
>>>>>>>     var failed: List[java.io.File] = Nil
>>>>>>>
>>>>>>>     def handled(file: String) =
>>>>>>>       file.endsWith(".html") || file.endsWith(".xml") ||
>>>>>>>       file.endsWith(".htm")  || file.endsWith(".xhtml")
>>>>>>>
>>>>>>>     def wellFormed(file: java.io.File) {
>>>>>>>       if (file.isDirectory)
>>>>>>>         for (f <- file.listFiles) wellFormed(f)
>>>>>>>
>>>>>>>       if (file.isFile && handled(file.getName)) {
>>>>>>>         try {
>>>>>>>           scala.xml.XML.loadFile(file)
>>>>>>>         } catch {
>>>>>>>           case e: org.xml.sax.SAXParseException => failed = file ::
>>>>>>> failed
>>>>>>>         }
>>>>>>>       }
>>>>>>>     }
>>>>>>>
>>>>>>>     wellFormed(new java.io.File("src/main/webapp"))
>>>>>>>
>>>>>>>     val numFails = failed.size
>>>>>>>     if (numFails > 0) {
>>>>>>>       val fileStr = if (numFails == 1) "file" else "files"
>>>>>>>       val msg = "Malformed XML in " + numFails + " " + fileStr + ": "
>>>>>>> + failed.mkString(", ")
>>>>>>>       println(msg)
>>>>>>>       fail(msg)
>>>>>>>     }
>>>>>>>   }
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Nov 26, 2008 at 4:58 PM, Jorge Ortiz <[EMAIL PROTECTED]>wrote:
>>>>>>>
>>>>>>>> Folks,
>>>>>>>>
>>>>>>>> One of the concerns raised at the Lift Workshop on Saturday was that
>>>>>>>> ill-formed XML files in your templates will fail at run time instead of
>>>>>>>> compile time, often with cryptic errors.
>>>>>>>>
>>>>>>>> To correct for this, I've added a simple test to
>>>>>>>> lift-archetype-basic and lift-archetype-blank that will test all 
>>>>>>>> *.html and
>>>>>>>> *.xml files in your src/main/webapp directory (and its subdirectories) 
>>>>>>>> to
>>>>>>>> make sure they can all be loaded by Scala's XML parser. If they can't 
>>>>>>>> be
>>>>>>>> loaded the test will fail and notify you which files couldn't be 
>>>>>>>> loaded and
>>>>>>>> why.
>>>>>>>>
>>>>>>>> These tests run during Maven's 'test' phase. This phase is required
>>>>>>>> before the 'package', 'install', or 'deploy' phases can run. 
>>>>>>>> Unfortunately,
>>>>>>>> the 'jetty:run' phase only requires 'test-compile', not 'test'. If you 
>>>>>>>> want
>>>>>>>> the test to run before starting Jetty, you'll have to specify it 
>>>>>>>> manually:
>>>>>>>> 'mvn test jetty:run' (or 'mvn install jetty:run', etc).
>>>>>>>>
>>>>>>>> The test is available on any new projects created with Lift's
>>>>>>>> archetypes. To add the test to your own project, the code is included 
>>>>>>>> below.
>>>>>>>> It's a simple JUnit test. If you used a previous version of the 
>>>>>>>> archetypes
>>>>>>>> to start your project, you can throw it into AppTest.scala
>>>>>>>>
>>>>>>>> Enjoy,
>>>>>>>>
>>>>>>>> --j
>>>>>>>>
>>>>>>>>
>>>>>>>>   /**
>>>>>>>>    * Tests to make sure the project's XML files are well-formed.
>>>>>>>>    *
>>>>>>>>    * Finds every *.html and *.xml file in src/main/webapp (and its
>>>>>>>>    * subdirectories) and tests to make sure they are well-formed.
>>>>>>>>    */
>>>>>>>>   def testXml() = {
>>>>>>>>     var failed: List[java.io.File] = Nil
>>>>>>>>
>>>>>>>>     def wellFormed(file: java.io.File) {
>>>>>>>>       if (file.isDirectory)
>>>>>>>>         for (f <- file.listFiles) wellFormed(f)
>>>>>>>>
>>>>>>>>       if (file.isFile && (file.getName.endsWith(".html") ||
>>>>>>>> file.getName.endsWith(".xml"))) {
>>>>>>>>         try {
>>>>>>>>           scala.xml.XML.loadFile(file)
>>>>>>>>         } catch {
>>>>>>>>           case e: org.xml.sax.SAXParseException => failed = file ::
>>>>>>>> failed
>>>>>>>>         }
>>>>>>>>       }
>>>>>>>>     }
>>>>>>>>
>>>>>>>>     wellFormed(new java.io.File("src/main/webapp"))
>>>>>>>>
>>>>>>>>     val numFails = failed.size
>>>>>>>>     if (numFails > 0) {
>>>>>>>>       val fileStr = if (numFails == 1) "file" else "files"
>>>>>>>>       val msg = "Malformed XML in " + numFails + " " + fileStr + ":
>>>>>>>> " + failed.mkString(", ")
>>>>>>>>       println(msg)
>>>>>>>>       fail(msg)
>>>>>>>>     }
>>>>>>>>   }
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to