Skip to content

Commit

Permalink
Convert plugin main class from Groovy to Java
Browse files Browse the repository at this point in the history
  • Loading branch information
voidzcy authored Mar 11, 2020
2 parents 1305d13 + 51bf461 commit 5ead51a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.gradle
/build/
/out/
.idea/

# Ignore Gradle GUI config
gradle-app.setting
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: java

jdk:
- oraclejdk8
- openjdk11

script:
- ./gradlew clean assemble test --stacktrace
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ sourceCompatibility = 1.8
// Releases must be built on Java 1.8
task checkJavaVersion {
doLast {
if (!javaVersion.isJava8()) {
if (!javaVersion.java8Compatible) {
throw new GradleException(
"The plugin must be published under Java 1.8 but ${javaVersion} is found")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.gradle.osdetector
package com.google.gradle.osdetector;

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Plugin;
import org.gradle.api.Project;

class OsDetectorPlugin implements Plugin<Project> {
void apply(final Project project) {
project.extensions.create('osdetector', OsDetector)
public class OsDetectorPlugin implements Plugin<Project> {

@Override
public void apply(final Project project) {
project.getExtensions().create("osdetector", OsDetector.class);
}

}

0 comments on commit 5ead51a

Please sign in to comment.