Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@Configuration
@Import(MyFrameworkConfiguration.class)
public class UserConfig implements MyFrameworkInitializer {
@Bean
public FooCallback fooCallback() {
return new FooCallback() {
public void doWithFoo(Foo foo) {
foo.setAwesome(true);
}
@cbeams
cbeams / links.md
Last active January 28, 2019 18:02
Links from "Spring Framework 3.2 – Themes and Trends" webinar on January 16th, 2013
@cbeams
cbeams / FlexiblePolymorphicMethodChaining.java
Created May 16, 2011 13:17
Flexible Polymorphic Method Chaining
/**
* Demonstrates a pattern for generic signatures in abstract base classes
* allowing for a method chaining API that is not dependent on order of method
* invocation: the concrete type (C in the case below) is always returned from
* every method that returns the generic parameter T.
*
* While the generic signatures are complex, using the concrete type C remains
* very simple. This tradeoff allows for the design of easy-to-use 'builder
* style' APIs.
*
@cbeams
cbeams / pgpSign.groovy
Created October 19, 2011 09:10
artifactory-pgp-plugin
/*
* Copyright 2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
class AndroidLanguageSourceSet extends BaseLanguageSourceSet {
}
class Rules {
@Defaults
public static void addDefaultAndroidSourceSet(@Path("android.sources") ModelMap<FunctionalSourceSet> sources) {
sources.all(new Action<FunctionalSourceSet>() {
@Override
class AndroidLanguageSourceSet extends BaseLanguageSourceSet {
}
class Rules {
@Defaults
public static void addDefaultAndroidSourceSet(@Path("android.sources") ModelMap<FunctionalSourceSet> sources) {
sources.all(new Action<FunctionalSourceSet>() {
@Override
apply plugin: GreetingPlugin
// Configure the 'greeting' extension object
greeting {
// Configure its 'message' property
message = 'Hi!'
}
class GreetingPlugin implements Plugin<Project> {

In this build, only the ':foo' subproject has had the java plugin applied.

As expected, only the ':foo' project has java-plugin related tasks, e.g. assemble.

However, both the ':foo' and ':foo:bar' subprojects have source sets configured.

Why does the ':foo:bar' subproject have source sets at all? Is this a bug?


public class Main { }