Разница между страницами «Gradle» и «Eclipse»

Материал из Home Wiki
(Различия между страницами)
Перейти к навигации Перейти к поиску
 
 
Строка 1: Строка 1:
[[:Категория:Работа]]
= Восстановление компиляции =
 
= Документация =
https://docs.gradle.org/current/userguide/userguide.html
 
= Включение анализа покрытия (jacoco) =


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
...
<projectDescription>
apply plugin: 'java'
    <buildSpec>
apply plugin: 'jacoco'
        <buildCommand>
...
            <name>org.eclipse.jdt.core.javabuilder</name>
jacocoTestReport {
            <arguments>
     reports {
            </arguments>
         xml.enabled false
        </buildCommand>
        csv.enabled false
    </buildSpec>
        html.destination "${buildDir}/jacocoHtml"
     <natures>
     }
         <nature>org.eclipse.jdt.core.javanature</nature>
}
     </natures>
...
</projectDescription>
</syntaxhighlight>
</syntaxhighlight>


После выполнения тестов сгенерировать покрытие:
= Зависание =
== Remote System Explorer Operation ==


<syntaxhighlight lang="bash">
Eclipse -> Preferences -> General -> Startup and Shutdown.
gradle jacocoTestReport
</syntaxhighlight>


= Запуск одного теста =
-Uncheck RSE UI.


https://docs.gradle.org/current/userguide/java_plugin.html
Eclipse -> Preferences -> Remote Systems.


<syntaxhighlight lang="bash">
-Uncheck Re-open Remote Systems view to previous state.
gradle -Dtest.single=<TestClassName> test
</syntaxhighlight>


= Исключить задачу =
Update your Eclipse to 4.3.1 (at least) due to a bug on previous version.


<syntaxhighlight lang="bash">
Restart Eclipse and its done.
gradle dist -x test
</syntaxhighlight>
 
 
= Исключение зависимости classpath используемого плагина =
 
https://github.com/uli-heller/uli-java-prototypes/pull/1/commits/30025f56ea40cd0fa699de3111cb309c553cec74
 
<syntaxhighlight>
apply from: 'https://raw.github.com/akhikhl/gretty/master/pluginScripts/gretty.plugin'
 
 
configurations {
  grettyRunnerTomcat7 {
    exclude group: 'org.slf4j', module: 'log4j-over-slf4j'
  }
}
 
gretty {
    ...
}
</syntaxhighlight>
 
= Запуск приложения с параметрами =
Запуск с параметрами <code>foo1 bar2</code>:
 
<syntaxhighlight>
gradle run --args='foo1 bar2'
</syntaxhighlight>
 
= Обход блокировок IP/HTTP =
Для обхода блокировок применяем следующие ключи:
<syntaxhighlight>
-Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3129
</syntaxhighlight>
В Jenkins заполняем поле "Switches" в расширенных настройках.
[[Категория:Работа]]
[[Категория:Java]]
[[Категория:Gradle]]

Версия 06:56, 14 ноября 2017

Восстановление компиляции

<projectDescription>
    <buildSpec>
        <buildCommand>
            <name>org.eclipse.jdt.core.javabuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>org.eclipse.jdt.core.javanature</nature>
    </natures>
</projectDescription>

Зависание

Remote System Explorer Operation

Eclipse -> Preferences -> General -> Startup and Shutdown.

-Uncheck RSE UI.

Eclipse -> Preferences -> Remote Systems.

-Uncheck Re-open Remote Systems view to previous state.

Update your Eclipse to 4.3.1 (at least) due to a bug on previous version.

Restart Eclipse and its done.