<?xml version="1.0" encoding="UTF-8"?>
<project name="frapi-manager" default="local">
  <property file="build.properties"/>
  
  <target name="setup" 
    description="Initial FRAPI workspace setup">
    <touch file="${root.path}/README.txt"/>
    <mkdir dir="${root.path}/tests"/>
    <touch file="${root.path}/tests/placeholder.txt" />
    <echo file="${root.path}/.gitignore">/build/*/</echo>
    <mkdir dir="${build.path.local}"/>
    <gitinit 
      gitPath="${git.path}"
      repository="${root.path}" />
    <gitclone 
      gitPath="${git.path}" 
      repository="${git.frapi-core.url}" 
      targetpath="${build.path.local}" />
    <gitcheckout 
      gitPath="${git.path}" 
      repository="${build.path.local}" 
      branchname="${git.frapi-core.commit}" />
    <move
      todir="${root.path}"
      includeemptydirs="true"
      overwrite="true"
      file="${frapi.custom.path.local}"/>
    <symlink 
     target="${root.path.custom}" 
     link="${frapi.custom.path.local}" /> 
    <exec
      command="git add .; git commit -m 'initial setup'" 
      dir="${root.path}" />
    <gitcheckout
        gitPath="${git.path}"
        repository="${root.path}"
        branchname="dev"
        create="true" />
  </target>  
  
  <resolvepath
      propertyName="root.path"
      file="${root.path}" />
  <resolvepath
      propertyName="root.path.custom"
      file="${root.path.custom}" />
  <resolvepath
      propertyName="build.path"
      file="${build.path}" />
  <resolvepath 
      propertyName="build.path.local" 
      file="${build.path.local}" />
  <resolvepath 
      propertyName="frapi.custom.path.local" 
      file="${frapi.custom.path.local}" />
</project>
