투케이2K

751. (Android/Gradle) [groovy] : [build.gradle] : while 문을 사용해 루프 반복문 수행 본문

Android

751. (Android/Gradle) [groovy] : [build.gradle] : while 문을 사용해 루프 반복문 수행

투케이2K 2024. 3. 21. 20:43
반응형

[개발 환경 설정]

개발 툴 : AndroidStudio

 

[소스 코드]

android {

    // [Groovy 문법 테스트]
    applicationVariants.all { variant ->
        if (variant.buildType.isDebuggable()){ // [개발 모드 인 경우]

            // [변수 선언 수행]
            def count = 1;

            // [while 문 수행]
            while (count <= 5) {
                println("while : " + count);

                count ++; // [증감]

            }
        }
    }
}
 

[결과 출력]

 

> Configure project :app
while : 1
while : 2
while : 3
while : 4
while : 5

 

반응형
Comments