What is the syntax for writing comments in build.gradle file?

前端 未结 2 2035
有刺的猬
有刺的猬 2021-01-30 08:06

Looking down this build.gradle file

apply plugin: \'com.android.application\'

android {
    compileSdkVersion 21
    buildToolsVersion \"21.1.2\"

         


        
相关标签:
2条回答
  • 2021-01-30 08:10

    Use the // or /* */

    For example:

            // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
        buildscript {
            repositories {
                jcenter()
            }
            dependencies {
                classpath 'com.android.tools.build:gradle:1.2.3'
    
                // NOTE: Do not place your application dependencies here; they belong
                // in the individual module build.gradle files
            }
        }
    
    /**
     * Returns the credential username used by Namirial Maven repository
     * Set this value in your ~/.gradle/gradle.properties with CREDENTIALS_USERNAME key
     * @return
     */
    def getCredentialsMavenUsername() {
        return hasProperty('CREDENTIALS_USERNAME') ? CREDENTIALS_USERNAME : ""
    }
    
    0 讨论(0)
  • 2021-01-30 08:30

    Easy:

    // Single line comment
    
    /*
     Multi
     line
     comment
    */
    
    0 讨论(0)
提交回复
热议问题