2016-06-19 8 views
0

私は現在、GradleとGitにいくつか問題があります。Gradleが別のgitブランチでファイルを作成するのはなぜですか?

私はアプリケーションを自動的に更新するためにfxlauncherを使用しています。 Gradleのビルドプロセスを使用して設定されます。ここにルートプロジェクトのbuild.gradleファイルがあります。

group 'de.zerotask' 
version '1.0-SNAPSHOT' 

apply plugin: 'java' 

sourceCompatibility = 1.8 

subprojects { 
    apply plugin: 'java' 
    apply plugin: 'maven' 

    sourceCompatibility = 1.8 

    repositories { 
     mavenCentral() 
    } 

    group 'de.zerotask' 
    version = rootProject.version 


} 

repositories { 
    mavenCentral() 
} 

dependencies { 
    testCompile group: 'junit', name: 'junit', version: '4.11' 

    compile project(':fx-framework') 
    compile project(':guice-injector') 

    compile 'no.tornado:fxlauncher:1.0.11' 
} 

// This part creates the app manifest needed for updating app 

// Installer Filename without suffix 
def appFilename = 'Taskflow' 

// The JavaFX Application class name 
def appMainClass = 'de.zerotask.taskflow.TaskflowApplication' 

// Optional override to specify where the cached files are stored. Default is current working directory 
def cacheDir = 'cache' 

// Optional parameters to the application, will be embedded in the launcher and can be overriden on the command line 
def appParameters = '' 

// The Application vendor used by javapackager 
def appVendor = 'Zerotask' 

// The Application version used by javapackager 
def appVersion = '1.0' 

// Base URL where you will host the application artifacts 
def appUrl = 'https://sirwindfield.github.io/taskflow/application-content/' 

// Optional scp target for application artifacts hosted at the above url 
def appDeployTarget = '' 

jar.archiveName = "taskflow.jar" 

task buildApp(dependsOn: ['copyDependencies', 'generateAppManifest', 'embedAppManifest']) 

task copyDependencies { 
    dependsOn jar 
    configurations.runtime.resolvedConfiguration.resolvedArtifacts.each { artifact -> 
     project.copy { 
      from artifact.file 
      into 'build/libs' 
      rename { "${artifact.name}.${artifact.extension}" } 
     } 
    } 
} 

task generateAppManifest(type: JavaExec) { 
    main = 'fxlauncher.CreateManifest' 
    classpath = sourceSets.main.runtimeClasspath 
    args = [appUrl, appMainClass, 'build/libs', '--cache-dir=' + cacheDir, appParameters] 
} 

task embedAppManifest(type: Exec) { 
    mustRunAfter 'generateAppManifest' 
    workingDir 'build/libs' 
    commandLine 'jar', 'uf', 'fxlauncher.jar', 'app.xml' 
} 

task installer(type: Exec, dependsOn: 'buildApp') { 
    commandLine 'javapackager', '-deploy', '-native', '-outdir', 'installer', '-outfile', appFilename, '-srcdir', 'build/libs', '-srcfiles', 'fxlauncher.jar', '-appclass', 'fxlauncher.Launcher', '-name', "${rootProject.name}", '-title', "${rootProject.name}", '-vendor', "$appVendor", "-Bidentifier", "${rootProject.group}.${appFilename}", '-Bidentifier=' + project.group + '.' + appFilename, '-BappVersion=' + appVersion 
} 

task deployApp(type: Exec, dependsOn: 'embedAppManifest') { 
    workingDir 'build/libs' 
    // commandLine 'scp', '-r', '.', appDeployTarget 
} 

これはすべてマスター上で実行する必要があります。私は、buildAppタスクをgradleで実行する前にブランチを切り替えたことを確認しました。 タスクが終了した後、gh-pagesブランチに切り替えました。 Gradleはまた、buildディレクトリと、各サブモジュールのbuildディレクトリを作成しました。 なぜ私は考えていない。私は、ファイルの変更は現在のブランチでのみ行われ、他のものでは起こらないと考えました。

誰かがこれを修正する方法について私の手伝いをして、なぜそれが起こっているのかを説明すると、本当に私を幸せにするでしょう!

答えて

2

レポにコミットされていないファイルは、ブランチを切り替えるときにワークスペースに残ります。これは、gradleとは関係ありませんが、gitの仕組みです。

+0

しかし、それらのファイルは私のビルドディレクトリです。私はそれらを元に戻すことを望んでいません。 gh-pagesブランチがそれらを無視してローカルに削除するように設定する方法はありますか? – SirWindfield

+0

これらのファイルはレポにコミットされていますか? –

関連する問題