Snippets Collections
URL internalURL = new URL(url)
return internalURL.openConnection().inputStream.withCloseable {
  it.bytes.encodeBase64();
}
...
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    // AndroidX libraries
    implementation 'androidx.core:core-ktx:1.9.0'
    implementation 'androidx.appcompat:appcompat:1.5.1'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.google.android.material:material:1.7.0'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'
    implementation 'androidx.leanback:leanback:1.1.0-rc02'
    implementation 'androidx.mediarouter:mediarouter:1.3.1'
    implementation 'androidx.palette:palette-ktx:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    implementation 'androidx.annotation:annotation:1.5.0'

    // Note: these libraries require that the Google repository has been declared
    // in the pluginManagement section of the top-level build.gradle file.
}
  pluginManagement {
      repositories {
          google()
          mavenCentral()
          gradlePluginPortal()
      }
  }
  dependencyResolutionManagement {
      repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
      repositories {
          google()
          mavenCentral()
      }
  }
  rootProject.name = "Test App"
  include ':app'
  
android {
  ...
  defaultConfig {
    ...
    minSdkVersion 26
    targetSdkVersion 29
  }
}
stage ('ANOTHER JOB'){
            steps {
                build job: "Release Helpers/(TEST) Schedule Release Job2",
                parameters: [
                    [$class: 'StringParameterValue', name: 'V', value: "${newRelease}"],
                    [$class: 'StringParameterValue', name: 'ReleaseDate', value: "${currentRelease}"]
                ]
            }
        }
pipeline {
    stages { ... }
    post {
       // only triggered when blue or green sign
       success {
           slackSend(channel: 'alerts-testing', color: 'good', message: ":party_parrot: NOTIFICATION: NEW RELEASE ${newRelease} WILL BE CREATED AUTOMATICALLY :party_parrot:")
       }
       // triggered when red sign
       failure {
           slackSend(channel: 'alerts-testing', color: 'RED', message: ":alarm_clock: NOTIFICATION: NEW RELEASE ${newRelease} WITH SOME FAILURE :alarm_clock:")
       }
       // trigger every-works
       always {
           slackSend ...
       }
    }
}
        newRelease = listLastReleaseTag(service[0])
        newRelease = "V${listLastReleaseTag(service[0])}"
pipeline {
    agent { label 'spot-instance' }
    
        stage('Print') {
            steps {
                script {
                    def now = new Date()
                    dateRelease = now.format("yyyy-MM-dd", TimeZone.getTimeZone('UTC'))
                    echo "Current date ${dateRelease}."
                }
            }
        }

        stage ('Run another Job'){
            steps {
                build job: "Release Helpers/(TEST) Schedule Release Job2",
                parameters: [
                    [$class: 'StringParameterValue', name: 'V', value: "${dateRelease}"]

                ]
            }
        }
}
pipeline {
    agent { label 'spot-instance' }
    
    environment {
        currentDate = sh(returnStdout: true, script: 'date +%Y-%m-%d').trim()
    }

        stage ('Run another Job'){
            steps {
                build job: "Release Helpers/(TEST) Schedule Release Job2",
                parameters: [
                    [$class: 'StringParameterValue', name: 'ReleaseDate', value: "${currentDate}"]

                ]
            }
        }
}

star

Wed Feb 01 2023 10:33:28 GMT+0000 (Coordinated Universal Time)

#groovy #base64
star

Sat Dec 31 2022 10:56:22 GMT+0000 (Coordinated Universal Time) https://developer.android.com/studio/intro/migrate

#groovy
star

Sat Dec 31 2022 10:56:11 GMT+0000 (Coordinated Universal Time) https://developer.android.com/studio/intro/migrate

#groovy
star

Tue Mar 01 2022 13:29:49 GMT+0000 (Coordinated Universal Time) https://developer.android.com/guide/components/fundamentals.html#Components

#groovy
star

Mon Aug 09 2021 10:33:23 GMT+0000 (Coordinated Universal Time)

#variable #groovy #jenkins #pipeline
star

Thu Aug 05 2021 11:19:16 GMT+0000 (Coordinated Universal Time)

#variable #groovy #jenkins #pipeline #currentdate
star

Thu Aug 05 2021 11:17:02 GMT+0000 (Coordinated Universal Time)

#variable #groovy #jenkins #pipeline

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension