Skip to content

Commit

Permalink
Allow to use Kotlin property assignment
Browse files Browse the repository at this point in the history
See https://kotlinlang.org/docs/java-interop.html#java-synthetic-property-references

>> Note that, if the Java class only has a setter, it isn't visible as a property in Kotlin because Kotlin doesn't support set-only properties.
  • Loading branch information
quaff committed Jun 11, 2024
1 parent 90d9e1a commit 76a20c4
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ dependencyManagement {
.Kotlin
----
dependencyManagement {
overriddenByDependencies(false)
isOverriddenByDependencies = false
}
----

Expand Down Expand Up @@ -782,7 +782,7 @@ dependencyManagement {
.Kotlin
----
dependencyManagement {
applyMavenExclusions(false)
isApplyMavenExclusions = false
}
----

Expand Down Expand Up @@ -864,7 +864,7 @@ dependencyManagement {
----
dependencyManagement {
generatedPomCustomization {
enabled(false)
isEnabled = false
}
}
----
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2024 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.
Expand Down Expand Up @@ -28,6 +28,7 @@
* Extension that provides the entry point to the dependency management plugin's DSL.
*
* @author Andy Wilkinson
* @author Yanming Zhou
*/
public interface DependencyManagementExtension extends DependencyManagementHandler {

Expand Down Expand Up @@ -68,6 +69,14 @@ public interface DependencyManagementExtension extends DependencyManagementHandl
*/
PomDependencyManagementConfigurer getPomConfigurer();

/**
* Whether or not Maven-style exclusions should be applied during dependency
* resolutions. The default is {@code true}.
* @return whether or not Maven-style exclusions should be applied during dependency
* resolutions.
*/
boolean isApplyMavenExclusions();

/**
* Set whether or not Maven-style exclusions should be applied during dependency
* resolutions. The default is {@code true}.
Expand All @@ -84,6 +93,14 @@ public interface DependencyManagementExtension extends DependencyManagementHandl
*/
void applyMavenExclusions(boolean applyMavenExclusions);

/**
* Whether dependency management should be overridden by versions declared on a
* project's dependencies. The default is {@code true}.
* @return Whether dependency management should be overridden by versions declared on
* a project's dependencies.
*/
boolean isOverriddenByDependencies();

/**
* Set whether dependency management should be overridden by versions declared on a
* project's dependencies. The default is {@code true}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2024 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.
Expand All @@ -20,9 +20,17 @@
* A handler for configuring the customization of generated POMs.
*
* @author Andy Wilkinson
* @author Yanming Zhou
*/
public interface GeneratedPomCustomizationHandler {

/**
* Whether or not customization of generated poms is enabled. Defaults to
* {@code true}.
* @return whether or not customization is enabled
*/
boolean isEnabled();

/**
* Sets whether or not customization of generated poms is enabled. Defaults to
* {@code true}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2024 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.
Expand All @@ -20,6 +20,7 @@
* Settings that control dependency management behaviour.
*
* @author Andy Wilkinson
* @author Yanming Zhou
*/
public class DependencyManagementSettings {

Expand All @@ -35,7 +36,7 @@ public class DependencyManagementSettings {
* @return {@code true} if Maven-style exclusions should be applied, otherwise
* {@code false}
*/
boolean isApplyMavenExclusions() {
public boolean isApplyMavenExclusions() {
return this.applyMavenExclusions;
}

Expand All @@ -56,7 +57,7 @@ public void setApplyMavenExclusions(boolean applyMavenExclusions) {
* versions, otherwise {@code
* false}
*/
boolean isOverriddenByDependencies() {
public boolean isOverriddenByDependencies() {
return this.overriddenByDependencies;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2024 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.
Expand Down Expand Up @@ -44,6 +44,7 @@
* Standard implementation of {@link DependencyManagementExtension}.
*
* @author Andy Wilkinson
* @author Yanming Zhou
*/
public class StandardDependencyManagementExtension extends GroovyObjectSupport
implements DependencyManagementExtension {
Expand Down Expand Up @@ -206,6 +207,11 @@ private DependencyManagementHandler handlerForConfiguration(Configuration config
return new StandardDependencyManagementHandler(this.dependencyManagementContainer, configuration);
}

@Override
public boolean isApplyMavenExclusions() {
return this.dependencyManagementSettings.isApplyMavenExclusions();
}

@Override
public void setApplyMavenExclusions(boolean applyMavenExclusions) {
this.dependencyManagementSettings.setApplyMavenExclusions(applyMavenExclusions);
Expand All @@ -216,6 +222,11 @@ public void applyMavenExclusions(boolean applyMavenExclusions) {
this.dependencyManagementSettings.setApplyMavenExclusions(applyMavenExclusions);
}

@Override
public boolean isOverriddenByDependencies() {
return this.dependencyManagementSettings.isOverriddenByDependencies();
}

@Override
public void setOverriddenByDependencies(boolean overriddenByDependencies) {
this.dependencyManagementSettings.setOverriddenByDependencies(overriddenByDependencies);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2024 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.
Expand All @@ -23,6 +23,7 @@
* Standard implementation of {@link GeneratedPomCustomizationHandler}.
*
* @author Andy Wilkinson
* @author Yanming Zhou
*/
class StandardGeneratedPomCustomizationHandler implements GeneratedPomCustomizationHandler {

Expand All @@ -32,6 +33,11 @@ class StandardGeneratedPomCustomizationHandler implements GeneratedPomCustomizat
this.settings = settings;
}

@Override
public boolean isEnabled() {
return this.settings.isEnabled();
}

@Override
public void setEnabled(boolean enabled) {
this.settings.setEnabled(enabled);
Expand Down

0 comments on commit 76a20c4

Please sign in to comment.