Skip to content

Commit

Permalink
Merge pull request #706 from Fiouz/replace_properties_with_fields
Browse files Browse the repository at this point in the history
refactor: directly expose `static final String` fields / remove getters
  • Loading branch information
johnrengelman authored Oct 4, 2021
2 parents 455d234 + 4048e07 commit c0d21cf
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import org.gradle.jvm.toolchain.JavaToolchainService

class ShadowApplicationPlugin implements Plugin<Project> {

static final String SHADOW_RUN_TASK_NAME = 'runShadow'
static final String SHADOW_SCRIPTS_TASK_NAME = 'startShadowScripts'
static final String SHADOW_INSTALL_TASK_NAME = 'installShadowDist'
public static final String SHADOW_RUN_TASK_NAME = 'runShadow'
public static final String SHADOW_SCRIPTS_TASK_NAME = 'startShadowScripts'
public static final String SHADOW_INSTALL_TASK_NAME = 'installShadowDist'

private Project project
private ApplicationPluginConvention pluginConvention
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import org.gradle.util.GradleVersion

class ShadowBasePlugin implements Plugin<Project> {

static final String EXTENSION_NAME = 'shadow'
static final String CONFIGURATION_NAME = 'shadow'
public static final String EXTENSION_NAME = 'shadow'
public static final String CONFIGURATION_NAME = 'shadow'

@Override
void apply(Project project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import javax.inject.Inject

class ShadowJavaPlugin implements Plugin<Project> {

static final String SHADOW_JAR_TASK_NAME = 'shadowJar'
static final String SHADOW_GROUP = 'Shadow'
public static final String SHADOW_JAR_TASK_NAME = 'shadowJar'
public static final String SHADOW_GROUP = 'Shadow'

private final ProjectConfigurationActionContainer configurationActionContainer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import org.gradle.api.tasks.TaskAction

class KnowsTask extends DefaultTask {

static final String NAME = "knows"
static final String DESC = "Do you know who knows?"
public static final String NAME = "knows"
public static final String DESC = "Do you know who knows?"

@TaskAction
def knows() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import org.gradle.api.file.FileTreeElement
class ComponentsXmlResourceTransformer implements Transformer {
private Map<String, Xpp3Dom> components = new LinkedHashMap<String, Xpp3Dom>()

static final String COMPONENTS_XML_PATH = "META-INF/plexus/components.xml"
public static final String COMPONENTS_XML_PATH = "META-INF/plexus/components.xml"

boolean canTransformResource(FileTreeElement element) {
def path = element.relativePath.pathString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import org.xml.sax.SAXException
*/
@CacheableTransformer
class XmlAppendingTransformer implements Transformer {
static final String XSI_NS = "http://www.w3.org/2001/XMLSchema-instance"
public static final String XSI_NS = "http://www.w3.org/2001/XMLSchema-instance"

@Input
boolean ignoreDtd = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import static org.junit.Assert.*
* Test for {@link ManifestAppenderTransformer}.
*/
class ManifestAppenderTransformerTest extends TransformerTestSupport {
static final String MANIFEST_NAME = "META-INF/MANIFEST.MF"
public static final String MANIFEST_NAME = "META-INF/MANIFEST.MF"

private ManifestAppenderTransformer transformer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class PluginSpecification extends Specification {

@Rule TemporaryFolder dir

static final String SHADOW_VERSION = PluginSpecification.classLoader.getResource("shadow-version.txt").text.trim()
public static final String SHADOW_VERSION = PluginSpecification.classLoader.getResource("shadow-version.txt").text.trim()

AppendableMavenFileRepository repo

Expand Down

0 comments on commit c0d21cf

Please sign in to comment.