Permalink
Browse files

Switch over to Tapestry 5.3-alpha-2

  • Loading branch information...
1 parent 730111d commit 39326ee84a4d4175fad8f9763a7dfe06aecbcca5 @hlship committed Jul 5, 2011
View
@@ -1,15 +1,18 @@
description = "Collection of add-ons for Tapestry 5"
-tapestryVersion = "5.3.0-SNAPSHOT"
+tapestryVersion = "5.3-alpha-2"
if (!project.hasProperty('deployUserName')) deployUserName = '*UNSET-USERNAME*'
if (!project.hasProperty('deployPassword')) deployPassword = '*UNSET-PASSWORD*'
+apply plugin: 'idea'
+
subprojects {
apply plugin: 'java'
apply plugin: 'groovy' // mostly for testing
apply plugin: 'eclipse'
+ apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'project-report'
@@ -29,9 +32,9 @@ subprojects {
// For the Kaptcha library
mavenRepo urls: "http://howardlewisship.com/repository/"
- // Latest snapshots
+ // Latest preview packages
- mavenRepo urls: "https://repository.apache.org/content/repositories/snapshots"
+ mavenRepo urls: "https://repository.apache.org/content/groups/staging"
}
configurations {
@@ -82,4 +85,13 @@ subprojects {
}
}
-}
+
+ ideaModule {
+ scopes.PROVIDED.plus += configurations.provided
+ javaVersion : "inherited"
+ }
+}
+
+ideaProject {
+ javaVersion : "1.5"
+}
@@ -37,7 +37,6 @@ public static void contributeApplicationDefaults(MappedConfiguration<String, Str
{
configuration.add(CoreSymbols.TEST_MODE, "true");
configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
- configuration.add(SymbolConstants.BLACKBIRD_ENABLED, "true");
}
@Contribute(ConditionSource.class)
@@ -14,8 +14,8 @@
package demo.services;
-import java.util.List;
-
+import com.howardlewisship.tapx.core.services.CoreModule;
+import com.howardlewisship.tapx.datefield.services.DateFieldModule;
import org.apache.tapestry5.SymbolConstants;
import org.apache.tapestry5.func.Flow;
import org.apache.tapestry5.ioc.Configuration;
@@ -24,8 +24,7 @@
import org.apache.tapestry5.ioc.services.Coercion;
import org.apache.tapestry5.ioc.services.CoercionTuple;
-import com.howardlewisship.tapx.core.services.CoreModule;
-import com.howardlewisship.tapx.datefield.services.DateFieldModule;
+import java.util.List;
@SubModule(
{ CoreModule.class, DateFieldModule.class })
@@ -35,7 +34,6 @@ public static void contributeApplicationDefaults(MappedConfiguration<String, Str
{
configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en,fr,de");
- configuration.add(SymbolConstants.BLACKBIRD_ENABLED, "true");
}
@SuppressWarnings("rawtypes")
@@ -1,4 +1,4 @@
-// Copyright 2010 Howard M. Lewis Ship
+// Copyright 2010, 2011 Howard M. Lewis Ship
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,14 +14,13 @@
package com.howardlewisship.tapx.yui.services;
+import com.howardlewisship.tapx.yui.YuiSymbols;
+import com.howardlewisship.tapx.yui.services.internal.ImportYUIWorker;
import org.apache.tapestry5.ioc.Configuration;
import org.apache.tapestry5.ioc.MappedConfiguration;
import org.apache.tapestry5.ioc.OrderedConfiguration;
-import org.apache.tapestry5.services.ComponentClassTransformWorker;
import org.apache.tapestry5.services.LibraryMapping;
-
-import com.howardlewisship.tapx.yui.YuiSymbols;
-import com.howardlewisship.tapx.yui.services.internal.ImportYUIWorker;
+import org.apache.tapestry5.services.transform.ComponentClassTransformWorker2;
public class YuiModule
{
@@ -33,7 +32,7 @@ public static void contributeFactoryDefaults(MappedConfiguration<String, String>
}
public static void contributeComponentClassTransformWorker(
- OrderedConfiguration<ComponentClassTransformWorker> configuration)
+ OrderedConfiguration<ComponentClassTransformWorker2> configuration)
{
configuration.addInstance("ImportYUI", ImportYUIWorker.class, "before:RenderPhase");
}
@@ -1,4 +1,4 @@
-// Copyright 2010 Howard M. Lewis Ship
+// Copyright 2010, 2011 Howard M. Lewis Ship
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,10 @@
package com.howardlewisship.tapx.yui.services.internal;
+import com.howardlewisship.tapx.yui.ImportYUI;
+import com.howardlewisship.tapx.yui.YuiSymbols;
import org.apache.tapestry5.Asset;
+import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.SymbolConstants;
import org.apache.tapestry5.annotations.BeginRender;
import org.apache.tapestry5.func.F;
@@ -23,19 +26,15 @@
import org.apache.tapestry5.func.Worker;
import org.apache.tapestry5.ioc.annotations.Symbol;
import org.apache.tapestry5.model.MutableComponentModel;
+import org.apache.tapestry5.plastic.*;
+import org.apache.tapestry5.runtime.Component;
+import org.apache.tapestry5.runtime.Event;
import org.apache.tapestry5.services.AssetSource;
-import org.apache.tapestry5.services.ClassTransformation;
-import org.apache.tapestry5.services.ComponentClassTransformWorker;
-import org.apache.tapestry5.services.ComponentMethodAdvice;
-import org.apache.tapestry5.services.ComponentMethodInvocation;
-import org.apache.tapestry5.services.TransformConstants;
-import org.apache.tapestry5.services.TransformMethod;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;
+import org.apache.tapestry5.services.transform.ComponentClassTransformWorker2;
+import org.apache.tapestry5.services.transform.TransformationSupport;
-import com.howardlewisship.tapx.yui.ImportYUI;
-import com.howardlewisship.tapx.yui.YuiSymbols;
-
-public class ImportYUIWorker implements ComponentClassTransformWorker
+public class ImportYUIWorker implements ComponentClassTransformWorker2
{
private final AssetSource assetSource;
@@ -45,15 +44,18 @@
private final boolean productionMode;
+ public static final MethodDescription BEGIN_RENDER_DESCRIPTION = PlasticUtils.getMethodDescription(Component.class,
+ "beginRender", MarkupWriter.class, Event.class);
+
public ImportYUIWorker(AssetSource assetSource,
- JavaScriptSupport javaScriptSupport,
+ JavaScriptSupport javaScriptSupport,
- @Symbol(YuiSymbols.BASE)
- String yuiBase,
+ @Symbol(YuiSymbols.BASE)
+ String yuiBase,
- @Symbol(SymbolConstants.PRODUCTION_MODE)
- boolean productionMode)
+ @Symbol(SymbolConstants.PRODUCTION_MODE)
+ boolean productionMode)
{
this.assetSource = assetSource;
this.javaScriptSupport = javaScriptSupport;
@@ -99,33 +101,34 @@ public void work(Asset value)
}
};
- public void transform(ClassTransformation transformation, MutableComponentModel model)
+ public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model)
{
- ImportYUI annotation = transformation.getAnnotation(ImportYUI.class);
+ ImportYUI annotation = plasticClass.getAnnotation(ImportYUI.class);
if (annotation == null)
+ {
return;
+ }
Flow<Asset> assetFlow = F.flow(annotation.value()).map(expandSimpleName).map(pathToAsset);
- addAdvicetoBeginRender(transformation, assetFlow);
+ addAdvicetoBeginRender(plasticClass, assetFlow);
model.addRenderPhase(BeginRender.class);
}
- private void addAdvicetoBeginRender(ClassTransformation transformation, Flow<Asset> assetFlow)
+ private void addAdvicetoBeginRender(PlasticClass transformation, Flow<Asset> assetFlow)
{
- TransformMethod method = transformation.getOrCreateMethod(TransformConstants.BEGIN_RENDER_SIGNATURE);
-
- method.addAdvice(createBeginRenderAdvice(assetFlow));
+ transformation.introduceMethod(BEGIN_RENDER_DESCRIPTION).addAdvice(
+ createBeginRenderAdvice(assetFlow));
}
- private ComponentMethodAdvice createBeginRenderAdvice(final Flow<Asset> assetFlow)
+ private MethodAdvice createBeginRenderAdvice(final Flow<Asset> assetFlow)
{
- return new ComponentMethodAdvice()
+ return new MethodAdvice()
{
- public void advise(ComponentMethodInvocation invocation)
+ public void advise(MethodInvocation invocation)
{
assetFlow.each(importLibrary);
@@ -1,4 +1,4 @@
-// Copyright 2010 Howard M. Lewis Ship
+// Copyright 2010, 2011 Howard M. Lewis Ship
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -30,7 +30,6 @@ public static void contributeApplicationDefaults(MappedConfiguration<String, Str
{
configuration.add(CoreSymbols.TEST_MODE, "true");
configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
- configuration.add(SymbolConstants.BLACKBIRD_ENABLED, "true");
}
}

0 comments on commit 39326ee

Please sign in to comment.