Skip to content
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: eriwen/gradle-js-plugin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: i-net-software/gradle-js-plugin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 5 commits
  • 12 files changed
  • 2 contributors

Commits on Oct 10, 2024

  1. Change plugin name for republishing

    The plugin has to be recompiled for it to work with gradle 5.0+
    mampcs authored and gamma committed Oct 10, 2024
    Copy the full SHA
    2653fcb View commit details
  2. Update to the latest google closure compiler

    mampcs authored and gamma committed Oct 10, 2024
    Copy the full SHA
    bd1fca6 View commit details
  3. Update Rhino

    gamma committed Oct 10, 2024
    Copy the full SHA
    08860a8 View commit details
  4. Update JavaScripts

    gamma committed Oct 10, 2024
    Copy the full SHA
    06c61a2 View commit details
  5. Copy the full SHA
    11d1f74 View commit details
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -8,3 +8,4 @@ out/
.idea/
intellij
gradle.properties
/.DS_Store
16 changes: 1 addition & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -9,24 +9,10 @@ Wrangling your JS in a [Gradle](https://gradle.org) build is easy! Just add this
### Gradle 2.1+
```groovy
plugins {
id "com.eriwen.gradle.js" version "2.14.1"
id "com.cloudzilla.gradle.js" version "2.16.2"
}
```

### Gradle 2.0-
```groovy
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.eriwen:gradle-js-plugin:1.12.1"
}
}
apply plugin: "com.eriwen.gradle.js"
```


```groovy
// Declare your sources
133 changes: 31 additions & 102 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
plugins {
id 'com.gradle.build-scan' version '2.0.2'
id "com.gradle.plugin-publish" version "0.9.4"
id "com.jfrog.bintray" version "1.6"
id "com.gradle.plugin-publish" version "0.12.0"
id "java-gradle-plugin"
}

apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'jacoco'
apply plugin: 'project-report'

sourceCompatibility = 1.6
targetCompatibility = 1.6
sourceCompatibility = 11
targetCompatibility = 11

defaultTasks 'clean', 'build'

version = '2.14.1'
group = 'com.eriwen'
version = '2.17.0'
group = 'de.inetsoftware.gradle'
ext.archivesBaseName = 'gradle-js-plugin'
ext.isSnapshot = version.endsWith("-SNAPSHOT")

buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}

repositories {
jcenter()
}
@@ -43,7 +36,7 @@ task createClasspathManifest {

dependencies {
compile gradleApi()
compile('com.google.javascript:closure-compiler:v20160208') {
compile('com.google.javascript:closure-compiler:v20240317') {
exclude module: 'junit'
}
compile('io.jdev.html2js:html2js:0.1') {
@@ -98,41 +91,34 @@ publishing {
}
}

gradlePlugin {
plugins {
jsPlugin {
id = 'com.cloudzilla.gradle.js'
implementationClass = 'com.eriwen.gradle.js.JsPlugin'
}
}
}


pluginBundle {
website = 'https://github.com/eriwen/gradle-js-plugin/'
vcsUrl = 'https://github.com/eriwen/gradle-js-plugin/'
website = 'https://github.com/mampcs/gradle-js-plugin/'
vcsUrl = 'https://github.com/mampcs/gradle-js-plugin/'
description = 'Gradle plugin for working with JS'
tags = ['javascript', 'jshint', 'requirejs']

plugins {
jsPlugin {
id = 'com.eriwen.gradle.js'
id = 'de.inetsoftware.gradle.js'
displayName = 'Gradle JavaScript Plugin'
}
}
mavenCoordinates {
groupId = 'com.eriwen'
groupId = 'de.inetsoftware.gradle'
artifactId = 'gradle-js-plugin'
}
}

signing {
sign configurations.archives
}

bintray {
user = System.properties['bintrayUsername']
key = System.properties['bintrayApiKey']
publications = ['maven']
pkg {
repo = 'gradle-plugins'
name = 'gradle-js-plugin'
desc = 'Gradle plugin for working with JS.'
licenses = ['Apache-2.0']
labels = ['gradle', 'js']
}
}

test {
systemProperties['version'] = version
testLogging {
@@ -142,68 +128,6 @@ test {
}
}

jacoco {
toolVersion = "0.7.6.201602180812"
reportsDir = file("$buildDir/customJacocoReportDir")
}

jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination file("${buildDir}/jacocoHtml")
}
}

jacocoTestCoverageVerification {
violationRules {
rule {
element = 'PACKAGE'
includes = ['com.eriwen.gradle.*']

limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.6
}
limit {
counter = 'CLASS'
value = 'MISSEDCOUNT'
maximum = 0
}
}
}
}

// Only *require* signing if we are uploading a non snapshot version
gradle.taskGraph.whenReady { taskGraph ->
tasks.withType(org.gradle.plugins.signing.Sign).all {
required = taskGraph.hasTask(":uploadArchives") && !isSnapshot
}
}

install.repositories.mavenInstaller {
pom.project(pomConfiguration)
if (signing.signatory) {
beforeDeployment { signing.signPom(it) }
}
}

uploadArchives {
repositories.mavenDeployer {
if (signing.signatory) {
beforeDeployment { signing.signPom(it) }
}
name = 'mavenCentralReleaseDeployer'
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: System.properties['mavenCentralUsername'], password: System.properties['mavenCentralPassword'])
releases(updatePolicy: 'always')
snapshots(updatePolicy: 'always')
}
pom.project(pomConfiguration)
}
}

/**
* Create POM config and return for use by other tasks.
*/
@@ -212,7 +136,7 @@ def getPomConfiguration() {
name 'Gradle JS Plugin'
packaging 'jar'
description 'A Gradle plugin for working with JS.'
url 'https://github.com/eriwen/gradle-js-plugin'
url 'https://github.com/i-net-software/gradle-js-plugin'
licenses {
license {
name 'The Apache Software License, Version 2.0'
@@ -226,11 +150,16 @@ def getPomConfiguration() {
name 'Eric Wendelin'
email 'me@eriwen.com'
}
developer {
id 'inetsoftware'
name 'i-net software GmbH'
email 'contact@inetsoftware.de'
}
}
scm {
connection 'scm:https://eriwen@github.com/eriwen/gradle-js-plugin'
developerConnection 'scm:git@github.com:eriwen/gradle-js-plugin.git'
url 'https://github.com/eriwen/gradle-js-plugin'
connection 'scm:https://gamma@github.com/i-net-software/gradle-js-plugin'
developerConnection 'scm:git@github.com/i-net-software/gradle-js-plugin.git'
url 'http://github.com/i-net-software/gradle-js-plugin'
}
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
2 changes: 1 addition & 1 deletion issue12.gradle
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ configurations {
}

dependencies {
rhino 'org.mozilla:rhino:1.7R3'
rhino 'org.mozilla:rhino:1.7.15'
}

apply plugin: 'js'
6 changes: 3 additions & 3 deletions src/main/groovy/com/eriwen/gradle/js/JsMinifier.groovy
Original file line number Diff line number Diff line change
@@ -25,13 +25,13 @@ class JsMinifier {
CompilationLevel.valueOf(compilationLevel).setOptionsForCompilationLevel(options)
WarningLevel level = WarningLevel.valueOf(warningLevel)
level.setOptionsForWarningLevel(options)
List<SourceFile> externs = CommandLineRunner.getBuiltinExterns(new CompilerOptions());
List<SourceFile> externs = CommandLineRunner.getBuiltinExterns(options.environment);
if (externsFiles.size()) {
externs.addAll(externsFiles.collect() { SourceFile.fromFile(it) })
externs.addAll(externsFiles.collect() { SourceFile.fromFile(it.absolutePath) })
}
List<SourceFile> inputs = new ArrayList<SourceFile>()
inputFiles.each { inputFile ->
inputs.add(SourceFile.fromFile(inputFile))
inputs.add(SourceFile.fromFile(inputFile.absolutePath))
}
Result result = compiler.compile(externs, inputs, options)
if (result.success) {
2 changes: 1 addition & 1 deletion src/main/groovy/com/eriwen/gradle/js/JsPlugin.groovy
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ class JsPlugin implements Plugin<Project> {
rhino
}
project.dependencies {
rhino 'org.mozilla:rhino:1.7R3'
rhino 'org.mozilla:rhino:1.7.15'
}
// TODO: have 'check' depend on jshint
}
5 changes: 3 additions & 2 deletions src/main/groovy/com/eriwen/gradle/js/tasks/JsDocTask.groovy
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ package com.eriwen.gradle.js.tasks

import com.eriwen.gradle.js.ResourceUtil
import com.eriwen.gradle.js.RhinoExec
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.SourceTask
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
@@ -28,8 +29,8 @@ class JsDocTask extends SourceTask {
private static final ResourceUtil RESOURCE_UTIL = new ResourceUtil()
private final RhinoExec rhino = new RhinoExec(project)

Iterable<String> modulePaths = ['lib', 'node_modules', 'rhino', '.']
Boolean debug = false
@Input Iterable<String> modulePaths = ['lib', 'node_modules', 'rhino', '.']
@Input Boolean debug = false

@OutputDirectory def destinationDir

Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ import org.gradle.api.tasks.SourceTask
import org.gradle.api.tasks.OutputFile

class JsHintTask extends SourceTask {
private static final String JSHINT_PATH = 'jshint-rhino-2.4.3.js'
private static final String JSHINT_PATH = 'jshint-rhino-2.13.6.js'
private static final String TMP_DIR = "tmp${File.separator}js"
private static final ResourceUtil RESOURCE_UTIL = new ResourceUtil()
private final RhinoExec rhino = new RhinoExec(project)
Loading